Also automatically hide dialogs from popupapplets if the last extender item is destroyed.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=875760
This commit is contained in:
Rob Scheepmaker 2008-10-25 14:17:17 +00:00
parent 34f4813559
commit d09ca6858f
2 changed files with 9 additions and 8 deletions

View File

@ -317,6 +317,15 @@ void ExtenderPrivate::addExtenderItem(ExtenderItem *item, const QPointF &pos)
void ExtenderPrivate::removeExtenderItem(ExtenderItem *item)
{
attachedExtenderItems.removeOne(item);
//collapse the popupapplet if the last item is removed.
if (!q->attachedItems().count()) {
PopupApplet *popupApplet = qobject_cast<PopupApplet*>(applet);
if (popupApplet) {
popupApplet->hidePopup();
}
}
q->itemRemovedEvent(item);
updateBorders();
}

View File

@ -203,14 +203,6 @@ void ExtenderItem::setExtender(Extender *extender, const QPointF &pos)
d->extender->d->removeExtenderItem(this);
emit d->extender->itemDetached(this);
//collapse the popupapplet if the last item is removed.
if (!d->extender->attachedItems().count()) {
PopupApplet *applet = qobject_cast<PopupApplet*>(d->extender->d->applet);
if (applet) {
applet->hidePopup();
}
}
//move the configuration.
if (d->hostApplet() && (extender != d->extender)) {
KConfigGroup c = extender->d->applet->config("ExtenderItems");