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 <axel.spoerl@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-06-15 13:56:14 +02:00
parent 89fe108590
commit e9276d7497

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