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 <axel.spoerl@qt.io>
(cherry picked from commit e9276d7497afeba3e116cb1044d37c341294780f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2023-06-15 13:56:14 +02:00 committed by Qt Cherry-pick Bot
parent a557b5af56
commit c85aa4947a

View File

@ -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()