From 9c2bc25a687d3e14259458deebdb0a30dfd4edc5 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Sun, 3 Jan 2021 09:10:59 +0100 Subject: [PATCH] [Notifications] Don't offer opening files in trash:/ I find it weird that when I've just trashed some files - presumably to get rid of them - it then offers me to open that file or the trash folder once done. --- .../notifications/package/contents/ui/JobItem.qml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/applets/notifications/package/contents/ui/JobItem.qml b/applets/notifications/package/contents/ui/JobItem.qml index 8a640153e..2460419fd 100644 --- a/applets/notifications/package/contents/ui/JobItem.qml +++ b/applets/notifications/package/contents/ui/JobItem.qml @@ -52,12 +52,16 @@ ColumnLayout { } // For a single file show actions for it - if (totalFiles === 1) { - return jobItem.jobDetails.descriptionUrl; // Otherwise the destination folder all of them were copied into - } else { - return jobItem.jobDetails.destUrl; + const url = totalFiles === 1 ? jobItem.jobDetails.descriptionUrl + : jobItem.jobDetails.destUrl; + + // Don't offer opening files in Trash + if (url && url.toString().startsWith("trash:")) { + return null; } + + return url; } property alias iconContainerItem: jobDragIcon.parent