notifitem: handle notification closed by app to prevent dismiss-on-destroyed error
This commit is contained in:
parent
2e3f3a9f3c
commit
1edd14cf30
1 changed files with 8 additions and 0 deletions
|
|
@ -42,6 +42,14 @@ QtObject {
|
||||||
return d > 0 ? d + "d" : h + "h";
|
return d > 0 ? d + "d" : h + "h";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// App closed the notification from its side — remove from our list while the object is still alive
|
||||||
|
readonly property Connections _notifConn: Connections {
|
||||||
|
target: root.notification
|
||||||
|
function onClosed() {
|
||||||
|
M.NotifService.dismiss(root.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function beginDismiss() {
|
function beginDismiss() {
|
||||||
if (state === "visible")
|
if (state === "visible")
|
||||||
state = "dismissing";
|
state = "dismissing";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue