diff --git a/applet.cpp b/applet.cpp index 2eb1371aa..1bcf5139f 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2302,13 +2302,15 @@ void AppletOverlayWidget::destroy() connect(Animator::self(), SIGNAL(animationFinished(QGraphicsItem*,Plasma::Animator::Animation)), this, - SLOT(overlayAnimationCompleteComplete(QGraphicsItem*,Plasma::Animator::Animation))); + SLOT(overlayAnimationComplete(QGraphicsItem*,Plasma::Animator::Animation))); Animator::self()->animateItem(this, Animator::DisappearAnimation); } -void AppletOverlayWidget::overlayAnimationComplete() +void AppletOverlayWidget::overlayAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation) { - deleteLater(); + if (item == this) { + deleteLater(); + } } void AppletOverlayWidget::paint(QPainter *painter, diff --git a/private/applet_p.h b/private/applet_p.h index 71453b486..fb4c186b8 100644 --- a/private/applet_p.h +++ b/private/applet_p.h @@ -26,6 +26,7 @@ #include +#include "plasma/animator.h" #include "plasma/private/dataengineconsumer_p.h" class KKeySequenceWidget; @@ -50,7 +51,7 @@ protected: void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); protected Q_SLOTS: - void overlayAnimationComplete(); + void overlayAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation); }; class AppletPrivate : public DataEngineConsumer