NOISSUE tabs -> spaces
This commit is contained in:
		@@ -22,7 +22,7 @@ generate_export_header(MultiMC_iconfix)
 | 
			
		||||
 | 
			
		||||
# Install it
 | 
			
		||||
install(
 | 
			
		||||
	TARGETS MultiMC_iconfix
 | 
			
		||||
	RUNTIME DESTINATION ${LIBRARY_DEST_DIR}
 | 
			
		||||
	LIBRARY DESTINATION ${LIBRARY_DEST_DIR}
 | 
			
		||||
    TARGETS MultiMC_iconfix
 | 
			
		||||
    RUNTIME DESTINATION ${LIBRARY_DEST_DIR}
 | 
			
		||||
    LIBRARY DESTINATION ${LIBRARY_DEST_DIR}
 | 
			
		||||
)
 | 
			
		||||
@@ -61,40 +61,40 @@
 | 
			
		||||
// internal helper. Converts an integer value to an unique string token
 | 
			
		||||
template <typename T> struct HexString
 | 
			
		||||
{
 | 
			
		||||
	inline HexString(const T t) : val(t)
 | 
			
		||||
	{
 | 
			
		||||
	}
 | 
			
		||||
    inline HexString(const T t) : val(t)
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	inline void write(QChar *&dest) const
 | 
			
		||||
	{
 | 
			
		||||
		const ushort hexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7',
 | 
			
		||||
								   '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
 | 
			
		||||
		const char *c = reinterpret_cast<const char *>(&val);
 | 
			
		||||
		for (uint i = 0; i < sizeof(T); ++i)
 | 
			
		||||
		{
 | 
			
		||||
			*dest++ = hexChars[*c & 0xf];
 | 
			
		||||
			*dest++ = hexChars[(*c & 0xf0) >> 4];
 | 
			
		||||
			++c;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	const T val;
 | 
			
		||||
    inline void write(QChar *&dest) const
 | 
			
		||||
    {
 | 
			
		||||
        const ushort hexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7',
 | 
			
		||||
                                   '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
 | 
			
		||||
        const char *c = reinterpret_cast<const char *>(&val);
 | 
			
		||||
        for (uint i = 0; i < sizeof(T); ++i)
 | 
			
		||||
        {
 | 
			
		||||
            *dest++ = hexChars[*c & 0xf];
 | 
			
		||||
            *dest++ = hexChars[(*c & 0xf0) >> 4];
 | 
			
		||||
            ++c;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    const T val;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// specialization to enable fast concatenating of our string tokens to a string
 | 
			
		||||
template <typename T> struct QConcatenable<HexString<T>>
 | 
			
		||||
{
 | 
			
		||||
	typedef HexString<T> type;
 | 
			
		||||
	enum
 | 
			
		||||
	{
 | 
			
		||||
		ExactSize = true
 | 
			
		||||
	};
 | 
			
		||||
	static int size(const HexString<T> &)
 | 
			
		||||
	{
 | 
			
		||||
		return sizeof(T) * 2;
 | 
			
		||||
	}
 | 
			
		||||
	static inline void appendTo(const HexString<T> &str, QChar *&out)
 | 
			
		||||
	{
 | 
			
		||||
		str.write(out);
 | 
			
		||||
	}
 | 
			
		||||
	typedef QString ConvertTo;
 | 
			
		||||
    typedef HexString<T> type;
 | 
			
		||||
    enum
 | 
			
		||||
    {
 | 
			
		||||
        ExactSize = true
 | 
			
		||||
    };
 | 
			
		||||
    static int size(const HexString<T> &)
 | 
			
		||||
    {
 | 
			
		||||
        return sizeof(T) * 2;
 | 
			
		||||
    }
 | 
			
		||||
    static inline void appendTo(const HexString<T> &str, QChar *&out)
 | 
			
		||||
    {
 | 
			
		||||
        str.write(out);
 | 
			
		||||
    }
 | 
			
		||||
    typedef QString ConvertTo;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -61,46 +61,46 @@ class QIconLoader;
 | 
			
		||||
 | 
			
		||||
struct QIconDirInfo
 | 
			
		||||
{
 | 
			
		||||
	enum Type
 | 
			
		||||
	{
 | 
			
		||||
		Fixed,
 | 
			
		||||
		Scalable,
 | 
			
		||||
		Threshold
 | 
			
		||||
	};
 | 
			
		||||
	QIconDirInfo(const QString &_path = QString())
 | 
			
		||||
		: path(_path), size(0), maxSize(0), minSize(0), threshold(0), type(Threshold)
 | 
			
		||||
	{
 | 
			
		||||
	}
 | 
			
		||||
	QString path;
 | 
			
		||||
	short size;
 | 
			
		||||
	short maxSize;
 | 
			
		||||
	short minSize;
 | 
			
		||||
	short threshold;
 | 
			
		||||
	Type type : 4;
 | 
			
		||||
    enum Type
 | 
			
		||||
    {
 | 
			
		||||
        Fixed,
 | 
			
		||||
        Scalable,
 | 
			
		||||
        Threshold
 | 
			
		||||
    };
 | 
			
		||||
    QIconDirInfo(const QString &_path = QString())
 | 
			
		||||
        : path(_path), size(0), maxSize(0), minSize(0), threshold(0), type(Threshold)
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
    QString path;
 | 
			
		||||
    short size;
 | 
			
		||||
    short maxSize;
 | 
			
		||||
    short minSize;
 | 
			
		||||
    short threshold;
 | 
			
		||||
    Type type : 4;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class QIconLoaderEngineEntry
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
	virtual ~QIconLoaderEngineEntry()
 | 
			
		||||
	{
 | 
			
		||||
	}
 | 
			
		||||
	virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) = 0;
 | 
			
		||||
	QString filename;
 | 
			
		||||
	QIconDirInfo dir;
 | 
			
		||||
	static int count;
 | 
			
		||||
    virtual ~QIconLoaderEngineEntry()
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
    virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) = 0;
 | 
			
		||||
    QString filename;
 | 
			
		||||
    QIconDirInfo dir;
 | 
			
		||||
    static int count;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct ScalableEntry : public QIconLoaderEngineEntry
 | 
			
		||||
{
 | 
			
		||||
	QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
 | 
			
		||||
	QIcon svgIcon;
 | 
			
		||||
    QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
 | 
			
		||||
    QIcon svgIcon;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct PixmapEntry : public QIconLoaderEngineEntry
 | 
			
		||||
{
 | 
			
		||||
	QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
 | 
			
		||||
	QPixmap basePixmap;
 | 
			
		||||
    QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
 | 
			
		||||
    QPixmap basePixmap;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef QList<QIconLoaderEngineEntry *> QThemeIconEntries;
 | 
			
		||||
@@ -109,107 +109,107 @@ typedef QList<QIconLoaderEngineEntry *> QThemeIconEntries;
 | 
			
		||||
class QIconLoaderEngineFixed : public QIconEngine
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
	QIconLoaderEngineFixed(const QString &iconName = QString());
 | 
			
		||||
	~QIconLoaderEngineFixed();
 | 
			
		||||
    QIconLoaderEngineFixed(const QString &iconName = QString());
 | 
			
		||||
    ~QIconLoaderEngineFixed();
 | 
			
		||||
 | 
			
		||||
	void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state);
 | 
			
		||||
	QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state);
 | 
			
		||||
	QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state);
 | 
			
		||||
	QIconEngine *clone() const;
 | 
			
		||||
	bool read(QDataStream &in);
 | 
			
		||||
	bool write(QDataStream &out) const;
 | 
			
		||||
    void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state);
 | 
			
		||||
    QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state);
 | 
			
		||||
    QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state);
 | 
			
		||||
    QIconEngine *clone() const;
 | 
			
		||||
    bool read(QDataStream &in);
 | 
			
		||||
    bool write(QDataStream &out) const;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
	QString key() const;
 | 
			
		||||
	bool hasIcon() const;
 | 
			
		||||
	void ensureLoaded();
 | 
			
		||||
	void virtual_hook(int id, void *data);
 | 
			
		||||
	QIconLoaderEngineEntry *entryForSize(const QSize &size);
 | 
			
		||||
	QIconLoaderEngineFixed(const QIconLoaderEngineFixed &other);
 | 
			
		||||
	QThemeIconEntries m_entries;
 | 
			
		||||
	QString m_iconName;
 | 
			
		||||
	uint m_key;
 | 
			
		||||
    QString key() const;
 | 
			
		||||
    bool hasIcon() const;
 | 
			
		||||
    void ensureLoaded();
 | 
			
		||||
    void virtual_hook(int id, void *data);
 | 
			
		||||
    QIconLoaderEngineEntry *entryForSize(const QSize &size);
 | 
			
		||||
    QIconLoaderEngineFixed(const QIconLoaderEngineFixed &other);
 | 
			
		||||
    QThemeIconEntries m_entries;
 | 
			
		||||
    QString m_iconName;
 | 
			
		||||
    uint m_key;
 | 
			
		||||
 | 
			
		||||
	friend class QIconLoader;
 | 
			
		||||
    friend class QIconLoader;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class QIconTheme
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
	QIconTheme(const QString &name);
 | 
			
		||||
	QIconTheme() : m_valid(false)
 | 
			
		||||
	{
 | 
			
		||||
	}
 | 
			
		||||
	QStringList parents()
 | 
			
		||||
	{
 | 
			
		||||
		return m_parents;
 | 
			
		||||
	}
 | 
			
		||||
	QVector<QIconDirInfo> keyList()
 | 
			
		||||
	{
 | 
			
		||||
		return m_keyList;
 | 
			
		||||
	}
 | 
			
		||||
	QString contentDir()
 | 
			
		||||
	{
 | 
			
		||||
		return m_contentDir;
 | 
			
		||||
	}
 | 
			
		||||
	QStringList contentDirs()
 | 
			
		||||
	{
 | 
			
		||||
		return m_contentDirs;
 | 
			
		||||
	}
 | 
			
		||||
	bool isValid()
 | 
			
		||||
	{
 | 
			
		||||
		return m_valid;
 | 
			
		||||
	}
 | 
			
		||||
    QIconTheme(const QString &name);
 | 
			
		||||
    QIconTheme() : m_valid(false)
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
    QStringList parents()
 | 
			
		||||
    {
 | 
			
		||||
        return m_parents;
 | 
			
		||||
    }
 | 
			
		||||
    QVector<QIconDirInfo> keyList()
 | 
			
		||||
    {
 | 
			
		||||
        return m_keyList;
 | 
			
		||||
    }
 | 
			
		||||
    QString contentDir()
 | 
			
		||||
    {
 | 
			
		||||
        return m_contentDir;
 | 
			
		||||
    }
 | 
			
		||||
    QStringList contentDirs()
 | 
			
		||||
    {
 | 
			
		||||
        return m_contentDirs;
 | 
			
		||||
    }
 | 
			
		||||
    bool isValid()
 | 
			
		||||
    {
 | 
			
		||||
        return m_valid;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
	QString m_contentDir;
 | 
			
		||||
	QStringList m_contentDirs;
 | 
			
		||||
	QVector<QIconDirInfo> m_keyList;
 | 
			
		||||
	QStringList m_parents;
 | 
			
		||||
	bool m_valid;
 | 
			
		||||
    QString m_contentDir;
 | 
			
		||||
    QStringList m_contentDirs;
 | 
			
		||||
    QVector<QIconDirInfo> m_keyList;
 | 
			
		||||
    QStringList m_parents;
 | 
			
		||||
    bool m_valid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class QIconLoader
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
	QIconLoader();
 | 
			
		||||
	QThemeIconEntries loadIcon(const QString &iconName) const;
 | 
			
		||||
	uint themeKey() const
 | 
			
		||||
	{
 | 
			
		||||
		return m_themeKey;
 | 
			
		||||
	}
 | 
			
		||||
    QIconLoader();
 | 
			
		||||
    QThemeIconEntries loadIcon(const QString &iconName) const;
 | 
			
		||||
    uint themeKey() const
 | 
			
		||||
    {
 | 
			
		||||
        return m_themeKey;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	QString themeName() const
 | 
			
		||||
	{
 | 
			
		||||
		return m_userTheme.isEmpty() ? m_systemTheme : m_userTheme;
 | 
			
		||||
	}
 | 
			
		||||
	void setThemeName(const QString &themeName);
 | 
			
		||||
	QIconTheme theme()
 | 
			
		||||
	{
 | 
			
		||||
		return themeList.value(themeName());
 | 
			
		||||
	}
 | 
			
		||||
	void setThemeSearchPath(const QStringList &searchPaths);
 | 
			
		||||
	QStringList themeSearchPaths() const;
 | 
			
		||||
	QIconDirInfo dirInfo(int dirindex);
 | 
			
		||||
	static QIconLoader *instance();
 | 
			
		||||
	void updateSystemTheme();
 | 
			
		||||
	void invalidateKey()
 | 
			
		||||
	{
 | 
			
		||||
		m_themeKey++;
 | 
			
		||||
	}
 | 
			
		||||
	void ensureInitialized();
 | 
			
		||||
    QString themeName() const
 | 
			
		||||
    {
 | 
			
		||||
        return m_userTheme.isEmpty() ? m_systemTheme : m_userTheme;
 | 
			
		||||
    }
 | 
			
		||||
    void setThemeName(const QString &themeName);
 | 
			
		||||
    QIconTheme theme()
 | 
			
		||||
    {
 | 
			
		||||
        return themeList.value(themeName());
 | 
			
		||||
    }
 | 
			
		||||
    void setThemeSearchPath(const QStringList &searchPaths);
 | 
			
		||||
    QStringList themeSearchPaths() const;
 | 
			
		||||
    QIconDirInfo dirInfo(int dirindex);
 | 
			
		||||
    static QIconLoader *instance();
 | 
			
		||||
    void updateSystemTheme();
 | 
			
		||||
    void invalidateKey()
 | 
			
		||||
    {
 | 
			
		||||
        m_themeKey++;
 | 
			
		||||
    }
 | 
			
		||||
    void ensureInitialized();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
	QThemeIconEntries findIconHelper(const QString &themeName, const QString &iconName,
 | 
			
		||||
									 QStringList &visited) const;
 | 
			
		||||
	uint m_themeKey;
 | 
			
		||||
	bool m_supportsSvg;
 | 
			
		||||
	bool m_initialized;
 | 
			
		||||
    QThemeIconEntries findIconHelper(const QString &themeName, const QString &iconName,
 | 
			
		||||
                                     QStringList &visited) const;
 | 
			
		||||
    uint m_themeKey;
 | 
			
		||||
    bool m_supportsSvg;
 | 
			
		||||
    bool m_initialized;
 | 
			
		||||
 | 
			
		||||
	mutable QString m_userTheme;
 | 
			
		||||
	mutable QString m_systemTheme;
 | 
			
		||||
	mutable QStringList m_iconDirs;
 | 
			
		||||
	mutable QHash<QString, QIconTheme> themeList;
 | 
			
		||||
    mutable QString m_userTheme;
 | 
			
		||||
    mutable QString m_systemTheme;
 | 
			
		||||
    mutable QStringList m_iconDirs;
 | 
			
		||||
    mutable QHash<QString, QIconTheme> themeList;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // QtXdg
 | 
			
		||||
 
 | 
			
		||||
@@ -46,17 +46,17 @@ namespace
 | 
			
		||||
{
 | 
			
		||||
struct QtIconCache : public IconCache
 | 
			
		||||
{
 | 
			
		||||
	QtIconCache()
 | 
			
		||||
	{
 | 
			
		||||
		qAddPostRoutine(qt_cleanup_icon_cache);
 | 
			
		||||
	}
 | 
			
		||||
    QtIconCache()
 | 
			
		||||
    {
 | 
			
		||||
        qAddPostRoutine(qt_cleanup_icon_cache);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
}
 | 
			
		||||
Q_GLOBAL_STATIC(IconCache, qtIconCache)
 | 
			
		||||
 | 
			
		||||
static void qt_cleanup_icon_cache()
 | 
			
		||||
{
 | 
			
		||||
	qtIconCache()->clear();
 | 
			
		||||
    qtIconCache()->clear();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/************************************************
 | 
			
		||||
@@ -78,7 +78,7 @@ XdgIcon::~XdgIcon()
 | 
			
		||||
 ************************************************/
 | 
			
		||||
QString XdgIcon::themeName()
 | 
			
		||||
{
 | 
			
		||||
	return QIcon::themeName();
 | 
			
		||||
    return QIcon::themeName();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/************************************************
 | 
			
		||||
@@ -86,8 +86,8 @@ QString XdgIcon::themeName()
 | 
			
		||||
 ************************************************/
 | 
			
		||||
void XdgIcon::setThemeName(const QString &themeName)
 | 
			
		||||
{
 | 
			
		||||
	QIcon::setThemeName(themeName);
 | 
			
		||||
	QtXdg::QIconLoader::instance()->updateSystemTheme();
 | 
			
		||||
    QIcon::setThemeName(themeName);
 | 
			
		||||
    QtXdg::QIconLoader::instance()->updateSystemTheme();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/************************************************
 | 
			
		||||
@@ -96,43 +96,43 @@ void XdgIcon::setThemeName(const QString &themeName)
 | 
			
		||||
 ************************************************/
 | 
			
		||||
QIcon XdgIcon::fromTheme(const QString &iconName, const QIcon &fallback)
 | 
			
		||||
{
 | 
			
		||||
	if (iconName.isEmpty())
 | 
			
		||||
		return fallback;
 | 
			
		||||
    if (iconName.isEmpty())
 | 
			
		||||
        return fallback;
 | 
			
		||||
 | 
			
		||||
	bool isAbsolute = (iconName[0] == '/');
 | 
			
		||||
    bool isAbsolute = (iconName[0] == '/');
 | 
			
		||||
 | 
			
		||||
	QString name = QFileInfo(iconName).fileName();
 | 
			
		||||
	if (name.endsWith(".png", Qt::CaseInsensitive) ||
 | 
			
		||||
		name.endsWith(".svg", Qt::CaseInsensitive) ||
 | 
			
		||||
		name.endsWith(".xpm", Qt::CaseInsensitive))
 | 
			
		||||
	{
 | 
			
		||||
		name.truncate(name.length() - 4);
 | 
			
		||||
	}
 | 
			
		||||
    QString name = QFileInfo(iconName).fileName();
 | 
			
		||||
    if (name.endsWith(".png", Qt::CaseInsensitive) ||
 | 
			
		||||
        name.endsWith(".svg", Qt::CaseInsensitive) ||
 | 
			
		||||
        name.endsWith(".xpm", Qt::CaseInsensitive))
 | 
			
		||||
    {
 | 
			
		||||
        name.truncate(name.length() - 4);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	QIcon icon;
 | 
			
		||||
    QIcon icon;
 | 
			
		||||
 | 
			
		||||
	if (qtIconCache()->contains(name))
 | 
			
		||||
	{
 | 
			
		||||
		icon = *qtIconCache()->object(name);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		QIcon *cachedIcon;
 | 
			
		||||
		if (!isAbsolute)
 | 
			
		||||
			cachedIcon = new QIcon(new QtXdg::QIconLoaderEngineFixed(name));
 | 
			
		||||
		else
 | 
			
		||||
			cachedIcon = new QIcon(iconName);
 | 
			
		||||
		qtIconCache()->insert(name, cachedIcon);
 | 
			
		||||
		icon = *cachedIcon;
 | 
			
		||||
	}
 | 
			
		||||
    if (qtIconCache()->contains(name))
 | 
			
		||||
    {
 | 
			
		||||
        icon = *qtIconCache()->object(name);
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        QIcon *cachedIcon;
 | 
			
		||||
        if (!isAbsolute)
 | 
			
		||||
            cachedIcon = new QIcon(new QtXdg::QIconLoaderEngineFixed(name));
 | 
			
		||||
        else
 | 
			
		||||
            cachedIcon = new QIcon(iconName);
 | 
			
		||||
        qtIconCache()->insert(name, cachedIcon);
 | 
			
		||||
        icon = *cachedIcon;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	// Note the qapp check is to allow lazy loading of static icons
 | 
			
		||||
	// Supporting fallbacks will not work for this case.
 | 
			
		||||
	if (qApp && !isAbsolute && icon.availableSizes().isEmpty())
 | 
			
		||||
	{
 | 
			
		||||
		return fallback;
 | 
			
		||||
	}
 | 
			
		||||
	return icon;
 | 
			
		||||
    // Note the qapp check is to allow lazy loading of static icons
 | 
			
		||||
    // Supporting fallbacks will not work for this case.
 | 
			
		||||
    if (qApp && !isAbsolute && icon.availableSizes().isEmpty())
 | 
			
		||||
    {
 | 
			
		||||
        return fallback;
 | 
			
		||||
    }
 | 
			
		||||
    return icon;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/************************************************
 | 
			
		||||
@@ -141,12 +141,12 @@ QIcon XdgIcon::fromTheme(const QString &iconName, const QIcon &fallback)
 | 
			
		||||
 ************************************************/
 | 
			
		||||
QIcon XdgIcon::fromTheme(const QStringList &iconNames, const QIcon &fallback)
 | 
			
		||||
{
 | 
			
		||||
	foreach (QString iconName, iconNames)
 | 
			
		||||
	{
 | 
			
		||||
		QIcon icon = fromTheme(iconName);
 | 
			
		||||
		if (!icon.isNull())
 | 
			
		||||
			return icon;
 | 
			
		||||
	}
 | 
			
		||||
    foreach (QString iconName, iconNames)
 | 
			
		||||
    {
 | 
			
		||||
        QIcon icon = fromTheme(iconName);
 | 
			
		||||
        if (!icon.isNull())
 | 
			
		||||
            return icon;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	return fallback;
 | 
			
		||||
    return fallback;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -36,13 +36,13 @@
 | 
			
		||||
class MULTIMC_ICONFIX_EXPORT XdgIcon
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
	static QIcon fromTheme(const QString &iconName, const QIcon &fallback = QIcon());
 | 
			
		||||
	static QIcon fromTheme(const QStringList &iconNames, const QIcon &fallback = QIcon());
 | 
			
		||||
    static QIcon fromTheme(const QString &iconName, const QIcon &fallback = QIcon());
 | 
			
		||||
    static QIcon fromTheme(const QStringList &iconNames, const QIcon &fallback = QIcon());
 | 
			
		||||
 | 
			
		||||
	static QString themeName();
 | 
			
		||||
	static void setThemeName(const QString &themeName);
 | 
			
		||||
    static QString themeName();
 | 
			
		||||
    static void setThemeName(const QString &themeName);
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
	explicit XdgIcon();
 | 
			
		||||
	virtual ~XdgIcon();
 | 
			
		||||
    explicit XdgIcon();
 | 
			
		||||
    virtual ~XdgIcon();
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user