This commit is contained in:
2025-08-08 05:34:05 +02:00
parent 8ce7aef412
commit b319a51c76
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -5,7 +5,7 @@
], ],
"dirs": [ "dirs": [
"~/.config/backgrounds", "~/.config/backgrounds",
"/run/media/kolkas/移硬1T/逆流茶会/" "~/Pictures/逆流茶会/"
], ],
"excludes": [ "excludes": [
"~/.config/backgrounds/nao-stars-crop-adjust-flop.jpg", "~/.config/backgrounds/nao-stars-crop-adjust-flop.jpg",
@@ -25,7 +25,7 @@
"no_loading_screen": true "no_loading_screen": true
}, },
"sort": { "sort": {
"type": "name", "type": "none",
"reverse": false "reverse": false
} }
} }
+2 -2
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 04:05:07 * @LastEditTime: 2025-08-08 05:12:37
* @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"
@@ -90,6 +90,7 @@ void ImagesCarousel::appendImages(const QStringList& paths) {
QMutexLocker locker(&m_countMutex); QMutexLocker locker(&m_countMutex);
m_addedImagesCount += paths.size(); m_addedImagesCount += paths.size();
} }
m_loadedImages.reserve(m_loadedImages.size() + paths.size());
emit loadingStarted(paths.size()); emit loadingStarted(paths.size());
for (const QString& path : paths) { for (const QString& path : paths) {
ImageLoader* loader = new ImageLoader(path, this); ImageLoader* loader = new ImageLoader(path, this);
@@ -130,7 +131,6 @@ void ImagesCarousel::_insertImage(const ImageData* data) {
}; };
// insert into correct position based on sort type and direction // insert into correct position based on sort type and direction
// currently O(n^2), but better as O(n * (n + log(n))) with vector and binary search
qint64 inserPos = m_loadedImages.size(); qint64 inserPos = m_loadedImages.size();
if (m_sortType != Config::SortType::None) { if (m_sortType != Config::SortType::None) {
for (auto it = m_loadedImages.rbegin(); for (auto it = m_loadedImages.rbegin();