Commit 52b62508 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Notifications] Offer "Open Containing Folder" whenever we have a destUrl

The restriction on having an amount of files to be processed was to avoid
showing whatever last file had been copied as destination.

However, we already only fall back to using the "destination" label contents
when there is a single file (cf. `NotificationManager::JobPrivate::destUrl()`),
making it safe to assume destUrl is always a predicatble/useful location.

CCBUG: 408778
parent e514898e
......@@ -46,8 +46,7 @@ ColumnLayout {
readonly property int totalFiles: jobItem.jobDetails && jobItem.jobDetails.totalFiles || 0
readonly property var url: {
if (jobItem.jobState !== NotificationManager.Notifications.JobStateStopped
|| jobItem.jobError
|| totalFiles <= 0) {
|| jobItem.jobError) {
return null;
}
......@@ -222,9 +221,9 @@ ColumnLayout {
id: openButton
height: Math.max(implicitHeight, otherFileActionsButton.implicitHeight)
// would be nice to have the file icon here?
text: jobItem.jobDetails && jobItem.jobDetails.totalFiles > 1
? i18nd("plasma_applet_org.kde.plasma.notifications", "Open Containing Folder")
: i18nd("plasma_applet_org.kde.plasma.notifications", "Open")
text: jobItem.jobDetails && jobItem.jobDetails.totalFiles === 1
? i18nd("plasma_applet_org.kde.plasma.notifications", "Open")
: i18nd("plasma_applet_org.kde.plasma.notifications", "Open Containing Folder")
onClicked: jobItem.openUrl(jobItem.url)
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment