From 5da1b64da09e4c12bf850750cd1cf18b5bab3210 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 13 Jun 2025 23:31:47 +1000 Subject: internal: better caching impl WARNING: causes blocking when caching image on first load --- utils/Paths.qml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'utils') diff --git a/utils/Paths.qml b/utils/Paths.qml index 011bb1f..88267ea 100644 --- a/utils/Paths.qml +++ b/utils/Paths.qml @@ -1,6 +1,7 @@ pragma Singleton import Quickshell +import Quickshell.Io import Qt.labs.platform Singleton { @@ -12,4 +13,19 @@ Singleton { readonly property url data: `${StandardPaths.standardLocations(StandardPaths.GenericDataLocation)[0]}/caelestia` readonly property url state: `${StandardPaths.standardLocations(StandardPaths.GenericStateLocation)[0]}/caelestia` readonly property url cache: `${StandardPaths.standardLocations(StandardPaths.GenericCacheLocation)[0]}/caelestia` + + readonly property url imagecache: `${cache}/imagecache` + + function mkdir(path: url): void { + mkdirProc.path = path.toString().replace("file://", ""); + mkdirProc.startDetached(); + } + + Process { + id: mkdirProc + + property string path + + command: ["mkdir", "-p", path] + } } -- cgit v1.2.3-freya