From e9276d7497afeba3e116cb1044d37c341294780f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 15 Jun 2023 13:56:14 +0200 Subject: [PATCH] QIconLoader: Invalidate cache even if system theme hasn't changed name The platform theme's icon loading logic may still have changed, even if the theme name has not, so we still need to invalidate the theme cache. Pick-to: 6.5 6.6 Change-Id: Id3635c235fadb007df86d93ce3beb5622d26b8bf Reviewed-by: Axel Spoerl --- src/gui/image/qiconloader.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 9542b20779..da44bbfe5b 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -123,11 +123,12 @@ void QIconLoader::updateSystemTheme() m_systemTheme = systemThemeName(); if (m_systemTheme.isEmpty()) m_systemTheme = systemFallbackThemeName(); - if (m_systemTheme != currentSystemTheme) { + if (m_systemTheme != currentSystemTheme) qCDebug(lcIconLoader) << "Updated system theme to" << m_systemTheme; - if (!hasUserTheme()) - invalidateKey(); - } + // Invalidate even if the system theme name hasn't changed, as the + // theme itself may have changed its underlying icon lookup logic. + if (!hasUserTheme()) + invalidateKey(); } void QIconLoader::invalidateKey()