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
This commit is contained in:
Ambroz Bizjak 2009-02-18 14:01:30 +00:00
parent 515aaf9895
commit 6ebe8f0b9f
3 changed files with 5 additions and 4 deletions

View File

@ -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;
}

View File

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

View File

@ -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();