don't crash when moving the focused applet from one containment to another

BUG:192589

svn path=/trunk/KDE/kdelibs/; revision=967669
This commit is contained in:
Aaron J. Seigo 2009-05-13 18:11:08 +00:00
parent 081e120ff7
commit 4ea997a9f1

View File

@ -749,6 +749,10 @@ void Containment::addApplet(Applet *applet, const QPointF &pos, bool delayInit)
if (currentContainment && currentContainment != this) { if (currentContainment && currentContainment != this) {
emit currentContainment->appletRemoved(applet); emit currentContainment->appletRemoved(applet);
if (currentContainment->d->focusedApplet == applet) {
currentContainment->d->focusedApplet = 0;
}
disconnect(applet, 0, currentContainment, 0); disconnect(applet, 0, currentContainment, 0);
applet->removeSceneEventFilter(currentContainment); applet->removeSceneEventFilter(currentContainment);
KConfigGroup oldConfig = applet->config(); KConfigGroup oldConfig = applet->config();