summaryrefslogtreecommitdiff
path: root/utils/Paths.qml
diff options
context:
space:
mode:
Diffstat (limited to 'utils/Paths.qml')
-rw-r--r--utils/Paths.qml8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/Paths.qml b/utils/Paths.qml
index cc8c712..ac95e80 100644
--- a/utils/Paths.qml
+++ b/utils/Paths.qml
@@ -16,6 +16,14 @@ Singleton {
readonly property url imagecache: `${cache}/imagecache`
+ function expandTilde(path: string): string {
+ return strip(path.replace("~", root.home.toString()));
+ }
+
+ function shortenHome(path: string): string {
+ return path.replace(strip(root.home.toString()), "~");
+ }
+
function strip(path: url): string {
return path.toString().replace("file://", "");
}