diff --git a/src/plasma/containment.cpp b/src/plasma/containment.cpp index 037a640ee..e6885298d 100644 --- a/src/plasma/containment.cpp +++ b/src/plasma/containment.cpp @@ -534,7 +534,7 @@ void Containment::addApplet(Applet *applet, const QPointF &pos) connect(applet, SIGNAL(configNeedsSaving()), this, SIGNAL(configNeedsSaving())); connect(applet, SIGNAL(releaseVisualFocus()), this, SIGNAL(releaseVisualFocus())); - connect(applet, SIGNAL(appletDeleted(Plasma::Applet*)), this, SLOT(appletDestroyed(Plasma::Applet*))); + connect(applet, SIGNAL(appletDeleted(Plasma::Applet*)), this, SLOT(appletDeleted(Plasma::Applet*))); connect(applet, SIGNAL(statusChanged(Plasma::ItemStatus)), this, SLOT(checkStatus(Plasma::ItemStatus))); connect(applet, SIGNAL(activate()), this, SIGNAL(activate())); diff --git a/src/plasma/private/applet_p.cpp b/src/plasma/private/applet_p.cpp index e09cb15cc..1dbea570d 100644 --- a/src/plasma/private/applet_p.cpp +++ b/src/plasma/private/applet_p.cpp @@ -172,6 +172,12 @@ void AppletPrivate::cleanUpAndDelete() resetConfigurationObject(); + if (isContainment) { + // prematurely emit our destruction if we are a Containment, + // giving Corona a chance to remove this Containment from its collection + emit q->QObject::destroyed(q); + } + q->deleteLater(); } diff --git a/src/shell/containments/testcontainment/contents/ui/main.qml b/src/shell/containments/testcontainment/contents/ui/main.qml index b869b47ae..67459f6df 100644 --- a/src/shell/containments/testcontainment/contents/ui/main.qml +++ b/src/shell/containments/testcontainment/contents/ui/main.qml @@ -52,6 +52,11 @@ Item { height: large + frame.margins.top + frame.margins.bottom property alias applet: appletContainer.children + onAppletChanged: { + if (appletContainer.children.length == 0) { + killAnim.running = true + } + } property int small: 90 property int large: 400 @@ -102,6 +107,16 @@ Item { running: visible anchors.centerIn: parent } + SequentialAnimation { + id: killAnim + NumberAnimation { + target: frame + properties: "scale" + to: 0 + duration: 250 + } + ScriptAction { script: frame.destroy()} + } } }