diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2015-09-08 17:22:01 +0200 |
---|---|---|
committer | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2015-09-13 16:23:24 +0000 |
commit | e68d06714fa29f986d0fc7de324b79ea94493dfc (patch) | |
tree | df80f8903542067ffe56dc553333495315ae7629 /src/gui/image/qiconloader_p.h | |
parent | 39a472430fb60b5020c94242f6bc071172772e01 (diff) |
QIconLoader: Use the GTK+ icon caches
Loading icons is quite slow because we need to stat many files in many directories.
That's why gtk adds a cache in the icon theme directory so it avoids stating lots
of files.
The cache file can be generated with gtk-update-icon-cache utility on a theme
directory. If the cache is not present, corrupted, or outdated, the normal slow lookup
is still run.
[ChangeLog][QtGui][QIcon] fromTheme gained the ability to use the GTK icon cache
to speed up lookups.
Change-Id: I3ab8a9910be67a34034556023be61a86789a7893
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/gui/image/qiconloader_p.h')
-rw-r--r-- | src/gui/image/qiconloader_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h index ccf0a9d438..193154e44e 100644 --- a/src/gui/image/qiconloader_p.h +++ b/src/gui/image/qiconloader_p.h @@ -139,6 +139,8 @@ private: friend class QIconLoader; }; +class QIconCacheGtkReader; + class QIconTheme { public: @@ -148,12 +150,13 @@ public: QVector<QIconDirInfo> keyList() { return m_keyList; } QStringList contentDirs() { return m_contentDirs; } bool isValid() { return m_valid; } - private: QStringList m_contentDirs; QVector<QIconDirInfo> m_keyList; QStringList m_parents; bool m_valid; +public: + QVector<QSharedPointer<QIconCacheGtkReader>> m_gtkCaches; }; class Q_GUI_EXPORT QIconLoader |