summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qiconloader_p.h
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2023-04-06 16:54:00 +0200
committerAxel Spoerl <axel.spoerl@qt.io>2023-04-11 15:19:22 +0200
commit74a4f9cb057506f17ba6902964106f5b1d87ad98 (patch)
tree04c45415695a03f09c1ef0355061e5cf46d040cb /src/gui/image/qiconloader_p.h
parent70f9158e0f046feba2d5b655a9b3fcc715d2e8be (diff)
Cache null icons and remove them upon system icon theme change
Since Qt 6, qIconCache does not store null icons. In case an icon name lookup is unsuccessful, the (expensive) lookup is repeated each time. This patch reverts 9e7c5670509ac81efdf78b691e70e5ce3d408a09, which removes a null icon from the cache once it has been found in the cache. In fact, that could no longer happen due to 4dc7102c8410f5699af93b6c55ba1c7df7755bc2, which prevented null icons from being cached at all. Therefore, it is also reverted by this patch. The cache will be cleared when - the system icon theme name changes or - QGuiApplicationPrivate::processThemeChanged is called (e.g. due to a change of the system's color scheme) Fixes: QTBUG-112257 Pick-to: 6.5 Change-Id: I80cd21fa39dc31c4bae60a8e66e78d9da20e9b4b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/image/qiconloader_p.h')
-rw-r--r--src/gui/image/qiconloader_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h
index cd3227c207..fbb21073ce 100644
--- a/src/gui/image/qiconloader_p.h
+++ b/src/gui/image/qiconloader_p.h
@@ -158,7 +158,7 @@ public:
QIconDirInfo dirInfo(int dirindex);
static QIconLoader *instance();
void updateSystemTheme();
- void invalidateKey() { m_themeKey++; }
+ void invalidateKey();
void ensureInitialized();
bool hasUserTheme() const { return !m_userTheme.isEmpty(); }