From 1e7c17ae241da149f567184a6ce23dea4834b0ac Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 18 Aug 2009 01:05:37 +0000 Subject: [PATCH] cleanups and another remove-before-deletion svn path=/trunk/KDE/kdelibs/; revision=1012704 --- applet.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/applet.cpp b/applet.cpp index 392494683..00c2ade04 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1,5 +1,3 @@ -#ifndef APPLET_CPP -#define APPLET_CPP /* * Copyright 2005 by Aaron Seigo * Copyright 2007 by Riccardo Iaconelli @@ -93,7 +91,6 @@ #include "private/popupapplet_p.h" #include "private/toolbox_p.h" -//#define DYNAMIC_SHADOWS namespace Plasma { @@ -438,11 +435,9 @@ bool Applet::destroyed() const void AppletPrivate::appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim) { - if (anim != Animator::DisappearAnimation || item != q) { - return; //it's not our time yet + if (anim == Animator::DisappearAnimation && item == q) { + cleanUpAndDelete(); } - - cleanUpAndDelete(); } void AppletPrivate::selectItemToDestroy() @@ -2540,6 +2535,9 @@ void AppletOverlayWidget::destroy() void AppletOverlayWidget::overlayAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation) { if (item == this) { + if (scene()) { + scene()->removeItem(this); + } deleteLater(); } } @@ -2582,4 +2580,3 @@ void AppletOverlayWidget::paint(QPainter *painter, #include "applet.moc" #include "private/applet_p.moc" -#endif // APPLET_CPP