diff --git a/applet.cpp b/applet.cpp index 7b4243dfd..2d6b47c8d 100644 --- a/applet.cpp +++ b/applet.cpp @@ -371,6 +371,11 @@ void Applet::destroy() } } +bool Applet::destroyed() const +{ + return d->transient; +} + void AppletPrivate::appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim) { if (anim != Animator::DisappearAnimation || item != q) { diff --git a/applet.h b/applet.h index 97fca77c4..0a1ae5895 100644 --- a/applet.h +++ b/applet.h @@ -550,6 +550,12 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget const QString &serviceId = QString(), uint appletId = 0); + /** + * @return true if destroy() was called; useful for Applets which should avoid + * certain tasks if they are about to be deleted permanently + */ + bool destroyed() const; + Q_SIGNALS: /** * This signal indicates that an application launch, window