Commit 499d145e authored by Karthik Periagaram's avatar Karthik Periagaram Committed by Kai Uwe Broulik

Label job notifications with destination file name

If a destination file name is present, it is a better label for a job
than the source file name. This is particularly true for web downloads
where the source file name may be a gibberish base64 string while the
destination file name would be selected by the user.

If there is no destination file name, we fall back to using the source
file name.

BUG: 396744

Differential Revision: https://phabricator.kde.org/D14857
parent 172bb819
......@@ -38,6 +38,7 @@ Column {
readonly property string labelName0: getData(jobsSource.data, "labelName0", '')
readonly property string labelName1: getData(jobsSource.data, "labelName1", '')
readonly property string labelFileName0: getData(jobsSource.data, "labelFileName0", '')
readonly property string labelFileName1: getData(jobsSource.data, "labelFileName1", '')
readonly property string label0: getData(jobsSource.data, "label0", '')
readonly property string label1: getData(jobsSource.data, "label1", '')
readonly property bool isSuspended: getData(jobsSource.data, "state", '') === "suspended"
......@@ -66,7 +67,7 @@ Column {
Layout.fillWidth: true
elide: Text.ElideMiddle
text: {
var label = labelFileName0;
var label = labelFileName1 || labelFileName0;
var lastSlashIdx = label.lastIndexOf("/");
return label.slice(lastSlashIdx + 1);
}
......
Markdown is supported
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