diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 19829c3d1fd..5f6ce0bbc7d 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -151,7 +151,13 @@ void QIconLoader::setThemeName(const QString &themeName) qCDebug(lcIconLoader) << "Setting user theme name to" << themeName; + const bool hadUserTheme = hasUserTheme(); m_userTheme = themeName; + // if we cleared the user theme, then reset search paths as well, + // otherwise we'll keep looking in the user-defined search paths for + // a system-provide theme, which will never work. + if (!hasUserTheme() && hadUserTheme) + setThemeSearchPath(systemIconSearchPaths()); invalidateKey(); }