From c5381c5194adf97c240acb98eb4c4c950633b325 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 4 Aug 2025 22:45:15 +1000 Subject: internal: refactor widgets folder Split into subdirs and rename to components --- widgets/CachingImage.qml | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 widgets/CachingImage.qml (limited to 'widgets/CachingImage.qml') diff --git a/widgets/CachingImage.qml b/widgets/CachingImage.qml deleted file mode 100644 index 1d42238..0000000 --- a/widgets/CachingImage.qml +++ /dev/null @@ -1,41 +0,0 @@ -import qs.utils -import Quickshell.Io -import QtQuick - -Image { - id: root - - property string path - property string hash - readonly property string cachePath: `${Paths.stringify(Paths.imagecache)}/${hash}@${width}x${height}.png` - - asynchronous: true - fillMode: Image.PreserveAspectCrop - sourceSize.width: width - sourceSize.height: height - - onPathChanged: shaProc.exec(["sha256sum", Paths.strip(path)]) - - onCachePathChanged: { - if (hash) - source = cachePath; - } - - onStatusChanged: { - if (source == cachePath && status === Image.Error) - source = path; - else if (source == path && status === Image.Ready) { - Paths.mkdir(Paths.imagecache); - const grabPath = cachePath; - grabToImage(res => res.saveToFile(grabPath)); - } - } - - Process { - id: shaProc - - stdout: StdioCollector { - onStreamFinished: root.hash = text.split(" ")[0] - } - } -} -- cgit v1.2.3-freya