From 32ff695d9e2993fcc904a58b3f5486b2285e8825 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:29:38 +1000 Subject: filedialog: better icon filtering Only thumbnail valid image types Also move wallpaper extensions into separate singleton in utils --- services/Wallpapers.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'services') diff --git a/services/Wallpapers.qml b/services/Wallpapers.qml index d72423b..2044c87 100644 --- a/services/Wallpapers.qml +++ b/services/Wallpapers.qml @@ -10,7 +10,6 @@ Searcher { id: root readonly property string currentNamePath: Paths.strip(`${Paths.state}/wallpaper/path.txt`) - readonly property list extensions: ["jpg", "jpeg", "png", "webp", "tif", "tiff"] property bool showPreview: false readonly property string current: showPreview ? previewPath : actualCurrent @@ -89,7 +88,7 @@ Searcher { running: true command: ["find", Paths.expandTilde(Config.paths.wallpaperDir), "-type", "d", "-path", '*/.*', "-prune", "-o", "-not", "-name", '.*', "-type", "f", "-print"] stdout: StdioCollector { - onStreamFinished: wallpapers.model = text.trim().split("\n").filter(w => root.extensions.includes(w.slice(w.lastIndexOf(".") + 1))).sort() + onStreamFinished: wallpapers.model = text.trim().split("\n").filter(w => Images.isValidImageByName(w)).sort() } } @@ -100,7 +99,7 @@ Searcher { command: ["inotifywait", "-r", "-e", "close_write,moved_to,create", "-m", Paths.expandTilde(Config.paths.wallpaperDir)] stdout: SplitParser { onRead: data => { - if (root.extensions.includes(data.slice(data.lastIndexOf(".") + 1))) + if (Images.isValidImageByName(data)) getWallsProc.running = true; } } -- cgit v1.2.3-freya