From 6ebe8f0b9fd890d7c1a06eddb1896b41df13de6d Mon Sep 17 00:00:00 2001 From: Ambroz Bizjak Date: Wed, 18 Feb 2009 14:01:30 +0000 Subject: [PATCH] backport revision 927886 Fix regressions introduced by 914888. 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=/branches/KDE/4.2/kdelibs/; revision=927891 --- 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 d4bf267a7..940ab2b44 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1769,9 +1769,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 ae9e4b95b..4cf2db94e 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 0c0a680f3..87e27c2ca 100644 --- a/private/applet_p.h +++ b/private/applet_p.h @@ -58,7 +58,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();