summaryrefslogtreecommitdiff
path: root/utils/Paths.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-07 17:58:18 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-07 17:58:18 +1000
commit8a6679eace029338747f0fe95ca683016fce783e (patch)
treecfec1f7045ac457478acf8917a123907ccee5d6c /utils/Paths.qml
parentdashboard: fix pfp picker (diff)
downloadcaelestia-shell-8a6679eace029338747f0fe95ca683016fce783e.tar.gz
caelestia-shell-8a6679eace029338747f0fe95ca683016fce783e.tar.bz2
caelestia-shell-8a6679eace029338747f0fe95ca683016fce783e.zip
paths: decode urls
Fixes spaces in paths breaking things
Diffstat (limited to 'utils/Paths.qml')
-rw-r--r--utils/Paths.qml10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/Paths.qml b/utils/Paths.qml
index ac95e80..0e3ac3b 100644
--- a/utils/Paths.qml
+++ b/utils/Paths.qml
@@ -16,16 +16,20 @@ Singleton {
readonly property url imagecache: `${cache}/imagecache`
+ function stringify(path: url): string {
+ return path.toString().replace(/%20/g, " ");
+ }
+
function expandTilde(path: string): string {
- return strip(path.replace("~", root.home.toString()));
+ return strip(path.replace("~", stringify(root.home)));
}
function shortenHome(path: string): string {
- return path.replace(strip(root.home.toString()), "~");
+ return path.replace(strip(root.home), "~");
}
function strip(path: url): string {
- return path.toString().replace("file://", "");
+ return stringify(path).replace("file://", "");
}
function mkdir(path: url): void {