Ubuntu Pastebin

Paste from daker at Wed, 22 Feb 2017 11:37:17 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    QImage findBestIcon(const QStringList &names, QSize *impsize, const QSize &size, QSet<QString> *alreadySearchedThemes)
    {
        if (alreadySearchedThemes) {
            if (alreadySearchedThemes->contains(name))
                return QImage();
            alreadySearchedThemes->insert(name);
        }

        Q_FOREACH(const QString &name, names) {
            if (QGuiApplication::layoutDirection() == Qt::RightToLeft)
            {
                QImage image = lookupIcon(name + "-rtl", impsize, size);
                if (!image.isNull())
                    return image;
            }

            QImage image = lookupIcon(name, impsize, size);
            if (!image.isNull())
                return image;
        }

        Q_FOREACH(IconThemePointer theme, parents) {
            QImage image = theme->findBestIcon(names, impsize, size, alreadySearchedThemes);
            if (!image.isNull())
                return image;
        }

        return QImage();
    }
Download as text