From 1a650b73bc75a7b617d9e0c24d680eae47218f3d Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 5 May 2025 19:06:32 +1000 Subject: thumbnailer: better caching --- modules/background/Wallpaper.qml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/background/Wallpaper.qml b/modules/background/Wallpaper.qml index 2ffc922..78624d5 100644 --- a/modules/background/Wallpaper.qml +++ b/modules/background/Wallpaper.qml @@ -28,23 +28,25 @@ Item { id: two } - component Img: Image { + component Img: CachingImage { id: img function update(): void { - if (source === root.source) + const srcPath = `${root.source}`.slice(7); + if (thumbnail.originalPath === srcPath) { root.current = this; - else - source = root.source; + } else + path = srcPath; } anchors.fill: parent + asynchronous: true + cache: false fillMode: Image.PreserveAspectCrop + opacity: 0 scale: Wallpapers.showPreview ? 1 : 0.8 - sourceSize.width: width - sourceSize.height: height onStatusChanged: { if (status === Image.Ready) -- cgit v1.2.3-freya