From c85aa4947a9a601e2b719a78ac38d9a83e191a90 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. Change-Id: Id3635c235fadb007df86d93ce3beb5622d26b8bf Reviewed-by: Axel Spoerl (cherry picked from commit e9276d7497afeba3e116cb1044d37c341294780f) Reviewed-by: Qt Cherry-pick Bot --- 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 cf8023c9c9b..2ad8b25b05b 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()