From a27a09fefc5d338e62867e1888ead593259dee03 Mon Sep 17 00:00:00 2001 From: Ambroz Bizjak Date: Wed, 18 Feb 2009 13:55:18 +0000 Subject: [PATCH] Fix regressions introduced by 914887. On the other hand, Corona::addItem indirectly calls Containment::itemChange, which ends up calling AppletPrivate::mainConfigGroup, which then creates a config group in the wrong file (plasmarc) because isContainment was not set. This also caused a regression where removed applets reappeared on next plasma run. Fix: Manually set isContainment before adding the item to the corona, then call setIsContainment with a new argument to force the initialization. svn path=/trunk/KDE/kdelibs/; revision=927886 --- applet.cpp | 4 ++-- corona.cpp | 3 ++- private/applet_p.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/applet.cpp b/applet.cpp index e0b359a38..ba6466548 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1936,9 +1936,9 @@ void Applet::lower() setZValue(--AppletPrivate::s_minZValue); } -void AppletPrivate::setIsContainment(bool nowIsContainment) +void AppletPrivate::setIsContainment(bool nowIsContainment, bool forceUpdate) { - if (isContainment == nowIsContainment) { + if (isContainment == nowIsContainment && !forceUpdate) { return; } diff --git a/corona.cpp b/corona.cpp index ca5855d43..86f57a401 100644 --- a/corona.cpp +++ b/corona.cpp @@ -152,8 +152,9 @@ public: containment->setFormFactor(Plasma::Planar); } + static_cast(containment)->d->isContainment = true; q->addItem(containment); - static_cast(containment)->d->setIsContainment(true); + static_cast(containment)->d->setIsContainment(true, true); containments.append(containment); if (!delayedInit) { diff --git a/private/applet_p.h b/private/applet_p.h index 6fb8e3b33..82e15ef71 100644 --- a/private/applet_p.h +++ b/private/applet_p.h @@ -62,7 +62,7 @@ public: /** * Sets whether or not this Applet is acting as a Containment */ - void setIsContainment(bool isContainment); + void setIsContainment(bool isContainment, bool forceUpdate = false); QString globalName() const; QString instanceName();