From b319a51c76b37793a1c600b66c31933da43ddf0f Mon Sep 17 00:00:00 2001 From: Uyanide Date: Fri, 8 Aug 2025 05:34:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.example.json | 4 ++-- src/images_carousel.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.example.json b/config.example.json index 2486d84..be8dc3e 100644 --- a/config.example.json +++ b/config.example.json @@ -5,7 +5,7 @@ ], "dirs": [ "~/.config/backgrounds", - "/run/media/kolkas/移硬1T/逆流茶会/" + "~/Pictures/逆流茶会/" ], "excludes": [ "~/.config/backgrounds/nao-stars-crop-adjust-flop.jpg", @@ -25,7 +25,7 @@ "no_loading_screen": true }, "sort": { - "type": "name", + "type": "none", "reverse": false } } \ No newline at end of file diff --git a/src/images_carousel.cpp b/src/images_carousel.cpp index 4244570..acf04a6 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 04:05:07 + * @LastEditTime: 2025-08-08 05:12:37 * @Description: Animated carousel widget for displaying and selecting images. */ #include "images_carousel.h" @@ -90,6 +90,7 @@ void ImagesCarousel::appendImages(const QStringList& paths) { QMutexLocker locker(&m_countMutex); m_addedImagesCount += paths.size(); } + m_loadedImages.reserve(m_loadedImages.size() + paths.size()); emit loadingStarted(paths.size()); for (const QString& path : paths) { 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 - // currently O(n^2), but better as O(n * (n + log(n))) with vector and binary search qint64 inserPos = m_loadedImages.size(); if (m_sortType != Config::SortType::None) { for (auto it = m_loadedImages.rbegin();