put the remove of the layout if the applet is removed in destroy function, then if we call
it from other place we will be sure the applet will be remove from the layout svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=805590
This commit is contained in:
parent
66413b26ab
commit
987ca211c7
@ -256,6 +256,14 @@ KConfigGroup Applet::globalConfig() const
|
||||
void Applet::destroy()
|
||||
{
|
||||
//kDebug() << "???????????????? DESTROYING APPLET" << name() << " ???????????????????????????";
|
||||
QGraphicsWidget * item = dynamic_cast<QGraphicsWidget *>(parentItem());
|
||||
//is the applet in a containment and is the containment have a layout? if yes, we remove the applet in the layout
|
||||
if (item) {
|
||||
QGraphicsLinearLayout * lay = dynamic_cast<QGraphicsLinearLayout *>(item->layout());
|
||||
if (lay) {
|
||||
lay->removeItem(this);
|
||||
}
|
||||
}
|
||||
if (d->configXml) {
|
||||
d->configXml->setDefaults();
|
||||
}
|
||||
|
@ -1024,15 +1024,7 @@ void Containment::Private::appletAnimationComplete(QGraphicsItem *item, Plasma::
|
||||
while (parent) {
|
||||
if (parent == q) {
|
||||
Applet *applet = qgraphicsitem_cast<Applet*>(item);
|
||||
|
||||
if (applet) {
|
||||
QGraphicsLinearLayout * lay = dynamic_cast<QGraphicsLinearLayout *>(q->layout());
|
||||
if (lay) {
|
||||
lay->removeItem(applet);
|
||||
}
|
||||
applet->destroy();
|
||||
}
|
||||
|
||||
applet->destroy();
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user