only save to the config file if we are the default theme

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=799909
This commit is contained in:
Aaron J. Seigo 2008-04-22 20:27:56 +00:00
parent 203fda098d
commit f1aba49d18

View File

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