From a8b71fe5c0175887100c16ed53382c91620984b0 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 17 Sep 2018 18:05:14 +0200 Subject: [PATCH] [Notifications] Store "Open..." action in history Actions stop working when the original notification goes away, however the "Open..." notification when a job completed is added and handled by us, so we can store it in the history and it will continue to function. BUG: 398732 FIXED-IN: 5.14.0 Differential Revision: https://phabricator.kde.org/D15578 --- .../notifications/package/contents/ui/Notifications.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/applets/notifications/package/contents/ui/Notifications.qml b/applets/notifications/package/contents/ui/Notifications.qml index e3f46d78c..23b34a319 100644 --- a/applets/notifications/package/contents/ui/Notifications.qml +++ b/applets/notifications/package/contents/ui/Notifications.qml @@ -88,6 +88,12 @@ Column { else if (showHistory) { notificationsHistoryModel.inserting = true; + + //Disable actions in this copy as they will stop working once the original notification is closed. + //Only the jobUrl (which is a URL to open) can continue working as we'll handle this internally. + var actions = notification.actions.filter(function (item) { + return item.id.indexOf("jobUrl#") === 0; + }); //create a copy of the notification. //Disable actions in this copy as they will stop working once the original notification is closed. @@ -101,7 +107,7 @@ Column { "created" : new Date(), "urls" : notification.urls, "maximumTextHeight" : notification.maximumTextHeight, - "actions" : null, + "actions" : actions, "hasDefaultAction" : false, "hasConfigureAction" : false, });