From 932e547cd9f57d7fad401020138ac9803ea4dc9f Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Tue, 30 Oct 2012 11:19:25 +0100 Subject: [PATCH] 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 --- applet.cpp | 8 ++++++++ widget.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/applet.cpp b/applet.cpp index ea9374c23..3c81f7735 100644 --- a/applet.cpp +++ b/applet.cpp @@ -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 diff --git a/widget.cpp b/widget.cpp index b262f667d..8ae4aa3d0 100644 --- a/widget.cpp +++ b/widget.cpp @@ -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); + } } }