Use basename of file in PrinterPage header

This commit is contained in:
Anton Thomasson 2021-03-06 16:25:08 +01:00
parent 0087596a69
commit e0eb980220
2 changed files with 6 additions and 1 deletions

View file

@ -66,7 +66,7 @@ Page {
PageHeader { PageHeader {
id: pageHeader id: pageHeader
title: printer.attrs["printer-name"].value title: printer.attrs["printer-name"].value
description: selectedFile description: Utils.basename(selectedFile)
} }
Item { Item {

View file

@ -379,6 +379,11 @@ function unknownForEmptyString(s)
} }
} }
function basename(filewithpath)
{
return filewithpath.substring(filewithpath.lastIndexOf("/")+1);
}
var media = var media =
{"asme_f_28x40in": "28 x 40″", {"asme_f_28x40in": "28 x 40″",
"choice_iso_a4_210x297mm_na_letter_8.5x11in": "A4 or US Letter", "choice_iso_a4_210x297mm_na_letter_8.5x11in": "A4 or US Letter",