pretend to fix moving plasmoids between containments; in reality we'll need a patch to KConfig* first to make this really work.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=755682
This commit is contained in:
Aaron J. Seigo 2008-01-02 01:38:29 +00:00
parent e3ff7be17d
commit add3c7eacd

View File

@ -552,12 +552,23 @@ void Containment::addApplet(Applet *applet)
Containment *currentContainment = applet->containment();
if (currentContainment && currentContainment != this) {
applet->removeSceneEventFilter(currentContainment);
KConfigGroup oldConfig = applet->config();
applet->resetConfigurationObject();
currentContainment->d->applets.removeAll(applet);
addChild(applet);
// now move the old config to the new location
KConfigGroup c = config();
c = KConfigGroup(&c, "Applets");
c = KConfigGroup(&c, QString::number(applet->id()));
//FIXME: without the next line, we don't save the applet configuration in the new location!
// this is pending a patch to KConfigGroup, however, so can't go in right now
//oldConfig.reparent(&c);
} else {
addChild(applet);
}
d->applets << applet;
addChild(applet);
if (currentContainment) {
applet->installSceneEventFilter(this);