internal: use Qt.resolvedUrl

This commit is contained in:
2 * r + 2 * t 2025-09-09 18:05:23 +10:00
parent 767ced0df3
commit 717855c629
7 changed files with 7 additions and 7 deletions

View file

@ -76,7 +76,7 @@ MouseArea {
}
function save(): void {
const tmpfile = `file:///tmp/caelestia-picker-${Quickshell.processId}-${Date.now()}.png`;
const tmpfile = Qt.resolvedUrl(`/tmp/caelestia-picker-${Quickshell.processId}-${Date.now()}.png`);
CUtils.saveItem(screencopy, tmpfile, Qt.rect(Math.ceil(rsx), Math.ceil(rsy), Math.floor(sw), Math.floor(sh)), path => Quickshell.execDetached(["swappy", "-f", path]));
closeAnim.start();
}

View file

@ -30,7 +30,7 @@ MouseArea {
let icon = root.modelData.icon;
if (icon.includes("?path=")) {
const [name, path] = icon.split("?path=");
icon = `file://${path}/${name.slice(name.lastIndexOf("/") + 1)}`;
icon = Qt.resolvedUrl(`${path}/${name.slice(name.lastIndexOf("/") + 1)}`);
}
return icon;
}

View file

@ -22,7 +22,7 @@ Item {
required property Item source
readonly property Item maskSource: mask
fragmentShader: `file://${Quickshell.shellDir}/assets/shaders/opacitymask.frag.qsb`
fragmentShader: Qt.resolvedUrl(`${Quickshell.shellDir}/assets/shaders/opacitymask.frag.qsb`)
}
Item {

View file

@ -22,7 +22,7 @@ Item {
filterLabel: qsTr("Image files")
filters: Images.validImageExtensions
onAccepted: path => {
if (CUtils.copyFile(`file://${path}`, Qt.resolvedUrl(`${Paths.home}/.face`)))
if (CUtils.copyFile(Qt.resolvedUrl(path), Qt.resolvedUrl(`${Paths.home}/.face`)))
Quickshell.execDetached(["notify-send", "-a", "caelestia-shell", "-u", "low", "-h", `STRING:image-path:${path}`, "Profile picture changed", `Profile picture changed to ${Paths.shortenHome(path)}`]);
else
Quickshell.execDetached(["notify-send", "-a", "caelestia-shell", "-u", "critical", "Unable to change profile picture", `Failed to change profile picture to ${Paths.shortenHome(path)}`]);

View file

@ -31,7 +31,7 @@ Item {
required property Item source
readonly property Item maskSource: mask
fragmentShader: `file://${Quickshell.shellDir}/assets/shaders/opacitymask.frag.qsb`
fragmentShader: Qt.resolvedUrl(`${Quickshell.shellDir}/assets/shaders/opacitymask.frag.qsb`)
}
opacity: status === Image.Ready ? 1 : 0

View file

@ -49,7 +49,7 @@ ColumnLayout {
Image {
asynchronous: true
source: `file://${Quickshell.shellDir}/assets/dino.png`
source: Qt.resolvedUrl(`${Quickshell.shellDir}/assets/dino.png`)
fillMode: Image.PreserveAspectFit
sourceSize.width: clipRect.width * 0.8

View file

@ -11,7 +11,7 @@ Singleton {
property string osPrettyName
property string osId
property list<string> osIdLike
property string osLogo: `file://${Quickshell.shellDir}/assets/logo.svg`
property string osLogo: Qt.resolvedUrl(`${Quickshell.shellDir}/assets/logo.svg`)
property bool isDefaultLogo: true
property string uptime