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
This commit is contained in:
Ambroz Bizjak 2009-02-18 13:55:18 +00:00
parent 699b688de7
commit a27a09fefc
3 changed files with 5 additions and 4 deletions

View File

@ -1936,9 +1936,9 @@ void Applet::lower()
setZValue(--AppletPrivate::s_minZValue); setZValue(--AppletPrivate::s_minZValue);
} }
void AppletPrivate::setIsContainment(bool nowIsContainment) void AppletPrivate::setIsContainment(bool nowIsContainment, bool forceUpdate)
{ {
if (isContainment == nowIsContainment) { if (isContainment == nowIsContainment && !forceUpdate) {
return; return;
} }

View File

@ -152,8 +152,9 @@ public:
containment->setFormFactor(Plasma::Planar); containment->setFormFactor(Plasma::Planar);
} }
static_cast<Applet*>(containment)->d->isContainment = true;
q->addItem(containment); q->addItem(containment);
static_cast<Applet*>(containment)->d->setIsContainment(true); static_cast<Applet*>(containment)->d->setIsContainment(true, true);
containments.append(containment); containments.append(containment);
if (!delayedInit) { if (!delayedInit) {

View File

@ -62,7 +62,7 @@ public:
/** /**
* Sets whether or not this Applet is acting as a Containment * 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 globalName() const;
QString instanceName(); QString instanceName();