* let the Corona know as soon as cleanUpAndDelete is called if we are a Containment
* simplify the path from an Applet being destroyed to cleanUpAndDelete being called svn path=/trunk/KDE/kdelibs/; revision=1192720
This commit is contained in:
parent
dd6b783e13
commit
92511efde0
18
applet.cpp
18
applet.cpp
@ -481,7 +481,7 @@ void Applet::destroy()
|
||||
d->cleanUpAndDelete();
|
||||
} else {
|
||||
Animation *zoomAnim = Plasma::Animator::create(Plasma::Animator::ZoomAnimation);
|
||||
connect(zoomAnim, SIGNAL(finished()), this, SLOT(appletAnimationComplete()));
|
||||
connect(zoomAnim, SIGNAL(finished()), this, SLOT(cleanUpAndDelete()));
|
||||
zoomAnim->setTargetWidget(this);
|
||||
zoomAnim->start();
|
||||
}
|
||||
@ -492,11 +492,6 @@ bool Applet::destroyed() const
|
||||
return d->transient;
|
||||
}
|
||||
|
||||
void AppletPrivate::appletAnimationComplete()
|
||||
{
|
||||
cleanUpAndDelete();
|
||||
}
|
||||
|
||||
void AppletPrivate::selectItemToDestroy()
|
||||
{
|
||||
//FIXME: this will not work nicely with multiple screens and being zoomed out!
|
||||
@ -550,7 +545,16 @@ void AppletPrivate::cleanUpAndDelete()
|
||||
|
||||
resetConfigurationObject();
|
||||
|
||||
q->scene()->removeItem(q);
|
||||
if (q->scene()) {
|
||||
if (isContainment()) {
|
||||
// prematurely emit our destruction if we are a Containment,
|
||||
// giving Corona a chance to remove this Containment from its collection
|
||||
emit destroyed(this);
|
||||
}
|
||||
|
||||
q->scene()->removeItem(q);
|
||||
}
|
||||
|
||||
q->deleteLater();
|
||||
}
|
||||
|
||||
|
2
applet.h
2
applet.h
@ -1117,7 +1117,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
Q_PRIVATE_SLOT(d, void setFocus())
|
||||
Q_PRIVATE_SLOT(d, void checkImmutability())
|
||||
Q_PRIVATE_SLOT(d, void themeChanged())
|
||||
Q_PRIVATE_SLOT(d, void appletAnimationComplete())
|
||||
Q_PRIVATE_SLOT(d, void cleanUpAndDelete())
|
||||
Q_PRIVATE_SLOT(d, void selectItemToDestroy())
|
||||
Q_PRIVATE_SLOT(d, void updateRect(const QRectF& rect))
|
||||
Q_PRIVATE_SLOT(d, void destroyMessageOverlay())
|
||||
|
@ -115,7 +115,6 @@ public:
|
||||
void checkImmutability();
|
||||
void themeChanged();
|
||||
void resetConfigurationObject();
|
||||
void appletAnimationComplete();
|
||||
void selectItemToDestroy();
|
||||
void updateRect(const QRectF &rect);
|
||||
void setFocus();
|
||||
|
Loading…
x
Reference in New Issue
Block a user