immediately save immutability and geometry settings when setting

this prevents them getting nuked when also writing to the config with writeConfig
which in turn triggers a config reload (without those values!) later on
This commit is contained in:
Aaron Seigo 2012-10-30 11:19:25 +01:00 committed by Marco Martin
parent 6095abcdbf
commit 932e547cd9
2 changed files with 12 additions and 0 deletions

View File

@ -234,6 +234,14 @@ void Applet::setLocked(bool locked)
}
app->setImmutability(locked ? Plasma::UserImmutable : Plasma::Mutable);
KConfigGroup cg = app->config();
if (!app->isContainment()) {
cg = cg.parent();
}
if (cg.isValid()) {
cg.writeEntry("immutability", (int)app->immutability());
}
}
bool Applet::locked() const

View File

@ -161,6 +161,10 @@ void Widget::setGeometry(const QRectF &geometry)
{
if (d->applet) {
d->applet.data()->setGeometry(geometry);
KConfigGroup cg = d->applet.data()->config().parent();
if (cg.isValid()) {
cg.writeEntry("geometry", geometry);
}
}
}