From a0cc31ff581fb33c679b2016d2d00d4d86cb7031 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 24 May 2025 16:31:23 +0800 Subject: refactor: path utils --- services/Colours.qml | 6 +++--- services/Thumbnailer.qml | 4 ++-- services/Wallpapers.qml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'services') diff --git a/services/Colours.qml b/services/Colours.qml index 07e2345..8b6ce00 100644 --- a/services/Colours.qml +++ b/services/Colours.qml @@ -1,10 +1,10 @@ pragma Singleton import "root:/config" +import "root:/utils" import Quickshell import Quickshell.Io import QtQuick -import Qt.labs.platform Singleton { id: root @@ -54,14 +54,14 @@ Singleton { } FileView { - path: `${StandardPaths.standardLocations(StandardPaths.GenericStateLocation)[0]}/caelestia/scheme/current-mode.txt` + path: `${Paths.state}/scheme/current-mode.txt` watchChanges: true onFileChanged: reload() onLoaded: root.light = text() === "light" } FileView { - path: `${StandardPaths.standardLocations(StandardPaths.GenericStateLocation)[0]}/caelestia/scheme/current.txt` + path: `${Paths.state}/scheme/current.txt` watchChanges: true onFileChanged: reload() onLoaded: root.load(text(), false) diff --git a/services/Thumbnailer.qml b/services/Thumbnailer.qml index 3d7a6c1..6a6066c 100644 --- a/services/Thumbnailer.qml +++ b/services/Thumbnailer.qml @@ -1,15 +1,15 @@ pragma Singleton pragma ComponentBehavior: Bound +import "root:/utils" import Quickshell import Quickshell.Io import QtQuick -import Qt.labs.platform Singleton { id: root - readonly property string thumbDir: `${StandardPaths.standardLocations(StandardPaths.GenericCacheLocation)[0]}/caelestia/thumbnails`.slice(7) + readonly property string thumbDir: `${Paths.cache}/thumbnails`.slice(7) function go(obj: var): var { return thumbComp.createObject(obj, { diff --git a/services/Wallpapers.qml b/services/Wallpapers.qml index 4bfa72f..1de5227 100644 --- a/services/Wallpapers.qml +++ b/services/Wallpapers.qml @@ -1,16 +1,16 @@ pragma Singleton import "root:/utils/scripts/fuzzysort.js" as Fuzzy +import "root:/utils" import Quickshell import Quickshell.Io import QtQuick -import Qt.labs.platform Singleton { id: root - readonly property string currentNamePath: `${StandardPaths.standardLocations(StandardPaths.GenericStateLocation)[0]}/caelestia/wallpaper/last.txt`.slice(7) - readonly property string path: `${StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]}/Wallpapers`.slice(7) + readonly property string currentNamePath: `${Paths.state}/wallpaper/last.txt`.slice(7) + readonly property string path: `${Paths.pictures}/Wallpapers`.slice(7) readonly property list list: wallpapers.instances property bool showPreview: false -- cgit v1.2.3-freya