From d071b6e301db6d3ecf0910c0d1a9a2a1abe73daa Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 25 Aug 2010 18:54:22 +0000 Subject: [PATCH] remove any stale config data to avoid accidentally merging old and existing containment configs svn path=/trunk/KDE/kdelibs/; revision=1167946 --- corona.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/corona.cpp b/corona.cpp index dba23cc87..3e8fe5864 100644 --- a/corona.cpp +++ b/corona.cpp @@ -230,6 +230,14 @@ public: containment->setFormFactor(Plasma::Planar); } + // if this is a new containment, we need to ensure that there are no stale + // configuration data around + if (id == 0) { + KConfigGroup conf(q->config(), "Containments"); + conf = KConfigGroup(&conf, QString::number(containment->id())); + conf.deleteGroup(); + } + applet->d->isContainment = true; containment->setPos(containment->d->preferredPos(q)); q->addItem(containment); @@ -448,7 +456,7 @@ void Corona::loadLayout(const QString &configName) } KSharedConfigPtr conf = config(); - d->importLayout(*conf, conf != config()); + d->importLayout(*conf, false); } QList Corona::importLayout(const KConfigBase &conf) @@ -490,6 +498,8 @@ QList CoronaPrivate::importLayout(const KConfigBase &conf if (mergeConfig) { KConfigGroup realConf(q->config(), "Containments"); realConf = KConfigGroup(&realConf, QString::number(cid)); + // in case something was there before us + realConf.deleteGroup(); containmentConfig.copyTo(&realConf); }