1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-01 19:18:28 -04:00

qs/common: fix path decoding

fixes #2802
port 1.5

(cherry picked from commit 56b7ecb008)
This commit is contained in:
bbedward
2026-07-10 10:49:50 -04:00
committed by purian23
parent 61f9ea4954
commit bf644516f8
+9 -1
View File
@@ -9,6 +9,8 @@ import qs.Services
Singleton {
id: root
readonly property var log: Log.scoped("Paths")
readonly property url home: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]
readonly property url pictures: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
readonly property url xdgCache: StandardPaths.standardLocations(StandardPaths.GenericCacheLocation)[0]
@@ -23,7 +25,13 @@ Singleton {
Component.onCompleted: mkdir(imagecache)
function stringify(path: url): string {
return path.toString().replace(/%20/g, " ");
const raw = path.toString();
try {
return decodeURIComponent(raw);
} catch (e) {
log.warn("failed to decode path:", raw, e);
return raw;
}
}
function expandTilde(path: string): string {