diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index 8f16bb6fb..9df0f4b59 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -63,6 +63,7 @@ ThemePrivate::ThemePrivate(QObject *parent) isDefault(true), useGlobal(true), hasWallpapers(false), + fixedName(false), backgroundContrastEnabled(true) { ThemeConfig config; @@ -456,6 +457,9 @@ void ThemePrivate::settingsFileChanged(const QString &file) void ThemePrivate::settingsChanged() { + if (fixedName) { + return; + } //qDebug() << "Settings Changed!"; KConfigGroup cg = config(); setThemeName(cg.readEntry("name", ThemePrivate::defaultTheme), false); @@ -575,7 +579,8 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings // the system colors. bool realTheme = theme != systemColorsTheme; if (realTheme) { - QString themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Char('/')); + QString themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % "/metadata.desktop"); + if (themePath.isEmpty() && themeName.isEmpty()) { themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/default"), QStandardPaths::LocateDirectory); diff --git a/src/plasma/private/theme_p.h b/src/plasma/private/theme_p.h index 488c7624b..e299e61b8 100644 --- a/src/plasma/private/theme_p.h +++ b/src/plasma/private/theme_p.h @@ -148,6 +148,7 @@ public: bool useGlobal : 1; bool hasWallpapers : 1; bool cacheTheme : 1; + bool fixedName : 1; qreal backgroundContrast; qreal backgroundIntensity; diff --git a/src/plasma/theme.cpp b/src/plasma/theme.cpp index 6b7b9110e..3acaf6ac6 100644 --- a/src/plasma/theme.cpp +++ b/src/plasma/theme.cpp @@ -81,6 +81,7 @@ Theme::Theme(const QString &themeName, QObject *parent) d->cacheTheme = false; d->setThemeName(themeName, false); d->cacheTheme = useCache; + d->fixedName = true; if (QCoreApplication::instance()) { connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), d, SLOT(onAppExitCleanup()));