[Applet] Don't crash on remove panel
REVIEW: 127240 CCBUG: 345723 Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
This commit is contained in:
parent
60af310cfc
commit
6bb02c88eb
@ -292,20 +292,24 @@ void AppletPrivate::askDestroy()
|
|||||||
emit q->immutabilityChanged(q->immutability());
|
emit q->immutabilityChanged(q->immutability());
|
||||||
if (deleteNotification) {
|
if (deleteNotification) {
|
||||||
deleteNotification->close();
|
deleteNotification->close();
|
||||||
}
|
} else if (deleteNotificationTimer) {
|
||||||
if (deleteNotificationTimer) {
|
deleteNotificationTimer->stop();
|
||||||
delete deleteNotificationTimer;
|
deleteNotificationTimer->deleteLater();
|
||||||
deleteNotificationTimer = 0;
|
deleteNotificationTimer = 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
QObject::connect(deleteNotification.data(), &KNotification::closed,
|
QObject::connect(deleteNotification.data(), &KNotification::closed, q,
|
||||||
[=]() {
|
[=]() {
|
||||||
//If the timer still exists, it means the undo action was NOT triggered
|
//If the timer still exists, it means the undo action was NOT triggered
|
||||||
if (deleteNotificationTimer) {
|
if (transient) {
|
||||||
transient = true;
|
|
||||||
emit q->destroyedChanged(true);
|
emit q->destroyedChanged(true);
|
||||||
cleanUpAndDelete();
|
cleanUpAndDelete();
|
||||||
}
|
}
|
||||||
|
if (deleteNotificationTimer) {
|
||||||
|
deleteNotificationTimer->stop();
|
||||||
|
deleteNotificationTimer->deleteLater();
|
||||||
|
deleteNotificationTimer = 0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
deleteNotification->sendEvent();
|
deleteNotification->sendEvent();
|
||||||
@ -314,14 +318,15 @@ void AppletPrivate::askDestroy()
|
|||||||
//really delete after a minute
|
//really delete after a minute
|
||||||
deleteNotificationTimer->setInterval(60 * 1000);
|
deleteNotificationTimer->setInterval(60 * 1000);
|
||||||
deleteNotificationTimer->setSingleShot(true);
|
deleteNotificationTimer->setSingleShot(true);
|
||||||
QObject::connect(deleteNotificationTimer, &QTimer::timeout,
|
QObject::connect(deleteNotificationTimer, &QTimer::timeout, q,
|
||||||
[=]() {
|
[=]() {
|
||||||
|
transient = true;
|
||||||
if (deleteNotification) {
|
if (deleteNotification) {
|
||||||
deleteNotification->close();
|
deleteNotification->close();
|
||||||
|
} else {
|
||||||
|
emit q->destroyedChanged(true);
|
||||||
|
cleanUpAndDelete();
|
||||||
}
|
}
|
||||||
transient = true;
|
|
||||||
emit q->destroyedChanged(true);
|
|
||||||
cleanUpAndDelete();
|
|
||||||
});
|
});
|
||||||
deleteNotificationTimer->start();
|
deleteNotificationTimer->start();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user