From 8f27b3673ba33f690fdea2dee6ce9e1027bf34ee Mon Sep 17 00:00:00 2001 From: Uyanide Date: Mon, 11 Aug 2025 19:44:29 +0200 Subject: [PATCH] fix: stuck if no images available --- config.example.json | 9 ++++----- src/images_carousel.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config.example.json b/config.example.json index be8dc3e..b67ddca 100644 --- a/config.example.json +++ b/config.example.json @@ -4,8 +4,7 @@ "~/Pictures/116327446_p0.jpg" ], "dirs": [ - "~/.config/backgrounds", - "~/Pictures/逆流茶会/" + "~/.config/backgrounds" ], "excludes": [ "~/.config/backgrounds/nao-stars-crop-adjust-flop.jpg", @@ -22,10 +21,10 @@ "image_focus_width": 480, "window_width": 750, "window_height": 500, - "no_loading_screen": true + "no_loading_screen": false }, "sort": { - "type": "none", - "reverse": false + "type": "date", + "reverse": true } } \ No newline at end of file diff --git a/src/images_carousel.cpp b/src/images_carousel.cpp index acf04a6..3b51ece 100644 --- a/src/images_carousel.cpp +++ b/src/images_carousel.cpp @@ -1,7 +1,7 @@ /* * @Author: Uyanide pywang0608@foxmail.com * @Date: 2025-08-05 01:22:53 - * @LastEditTime: 2025-08-08 05:12:37 + * @LastEditTime: 2025-08-11 19:44:06 * @Description: Animated carousel widget for displaying and selecting images. */ #include "images_carousel.h" @@ -86,6 +86,11 @@ ImagesCarousel::~ImagesCarousel() { } void ImagesCarousel::appendImages(const QStringList& paths) { + if (paths.isEmpty()) { + warn("No images to add to display."); + emit loadingCompleted(0); + return; + } { QMutexLocker locker(&m_countMutex); m_addedImagesCount += paths.size();