From 8a6679eace029338747f0fe95ca683016fce783e Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 7 Jul 2025 17:58:18 +1000 Subject: paths: decode urls Fixes spaces in paths breaking things --- utils/Paths.qml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'utils') 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 { -- cgit v1.2.3-freya