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 --- modules/background/Wallpaper.qml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'modules/background') diff --git a/modules/background/Wallpaper.qml b/modules/background/Wallpaper.qml index 2734034..f4e3243 100644 --- a/modules/background/Wallpaper.qml +++ b/modules/background/Wallpaper.qml @@ -8,7 +8,7 @@ import QtQuick Item { id: root - property url source: Wallpapers.current ? `file://${Wallpapers.current}` : "" + property string source: Wallpapers.current property Image current: one anchors.fill: parent @@ -32,20 +32,14 @@ Item { id: img function update(): void { - const srcPath = `${root.source}`.slice(7); - if (thumbnail.originalPath === srcPath) { + if (path === root.source) root.current = this; - } else - path = srcPath; + else + path = root.source; } anchors.fill: parent - loadOriginal: true - asynchronous: true - cache: false - fillMode: Image.PreserveAspectCrop - opacity: 0 scale: Wallpapers.showPreview ? 1 : 0.8 -- cgit v1.2.3-freya