fix: stuck if no images available

This commit is contained in:
2025-08-11 19:44:29 +02:00
parent b319a51c76
commit 8f27b3673b
2 changed files with 10 additions and 6 deletions
+4 -5
View File
@@ -4,8 +4,7 @@
"~/Pictures/116327446_p0.jpg" "~/Pictures/116327446_p0.jpg"
], ],
"dirs": [ "dirs": [
"~/.config/backgrounds", "~/.config/backgrounds"
"~/Pictures/逆流茶会/"
], ],
"excludes": [ "excludes": [
"~/.config/backgrounds/nao-stars-crop-adjust-flop.jpg", "~/.config/backgrounds/nao-stars-crop-adjust-flop.jpg",
@@ -22,10 +21,10 @@
"image_focus_width": 480, "image_focus_width": 480,
"window_width": 750, "window_width": 750,
"window_height": 500, "window_height": 500,
"no_loading_screen": true "no_loading_screen": false
}, },
"sort": { "sort": {
"type": "none", "type": "date",
"reverse": false "reverse": true
} }
} }
+6 -1
View File
@@ -1,7 +1,7 @@
/* /*
* @Author: Uyanide pywang0608@foxmail.com * @Author: Uyanide pywang0608@foxmail.com
* @Date: 2025-08-05 01:22:53 * @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. * @Description: Animated carousel widget for displaying and selecting images.
*/ */
#include "images_carousel.h" #include "images_carousel.h"
@@ -86,6 +86,11 @@ ImagesCarousel::~ImagesCarousel() {
} }
void ImagesCarousel::appendImages(const QStringList& paths) { void ImagesCarousel::appendImages(const QStringList& paths) {
if (paths.isEmpty()) {
warn("No images to add to display.");
emit loadingCompleted(0);
return;
}
{ {
QMutexLocker locker(&m_countMutex); QMutexLocker locker(&m_countMutex);
m_addedImagesCount += paths.size(); m_addedImagesCount += paths.size();