diff --git a/theme.cpp b/theme.cpp index c8bf68ffe..fc2ed5a89 100644 --- a/theme.cpp +++ b/theme.cpp @@ -195,10 +195,14 @@ void Theme::setThemeName(const QString &themeName) d->colors = KSharedConfig::openConfig(colorsFile); } - KConfigGroup cg = d->config(); - if (cg.readEntry("name", Private::defaultTheme) != d->themeName) { - cg.writeEntry("name", d->themeName); - cg.config()->sync(); + if (this == self()) { + // we're the defualt theme, let's save our state + KConfigGroup cg = d->config(); + if (Private::defaultTheme == d->themeName) { + cg.deleteEntry("name"); + } else { + cg.writeEntry("name", d->themeName); + } } emit changed();