From 5ff544ceabf7b770e6f04adb3df05a6746508e0f Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 22 Sep 2025 21:40:34 +1000 Subject: plugin/fsm: dont store comparator --- plugin/src/Caelestia/Models/filesystemmodel.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugin') diff --git a/plugin/src/Caelestia/Models/filesystemmodel.cpp b/plugin/src/Caelestia/Models/filesystemmodel.cpp index 2740cbd..feddea4 100644 --- a/plugin/src/Caelestia/Models/filesystemmodel.cpp +++ b/plugin/src/Caelestia/Models/filesystemmodel.cpp @@ -413,16 +413,18 @@ void FileSystemModel::applyChanges(const QSet& removedPaths, const QSet for (const auto& path : addedPaths) { newEntries << new FileSystemEntry(path, m_dir.relativeFilePath(path), this); } - const auto comp = [this](const FileSystemEntry* a, const FileSystemEntry* b) { + std::sort(newEntries.begin(), newEntries.end(), [this](const FileSystemEntry* a, const FileSystemEntry* b) { return compareEntries(a, b); - }; - std::sort(newEntries.begin(), newEntries.end(), comp); + }); int insertStart = -1; int prevRow = -1; QList batchItems; for (const auto& entry : newEntries) { - const auto it = std::lower_bound(m_entries.begin(), m_entries.end(), entry, comp); + const auto it = std::lower_bound( + m_entries.begin(), m_entries.end(), entry, [this](const FileSystemEntry* a, const FileSystemEntry* b) { + return compareEntries(a, b); + }); int row = static_cast(it - m_entries.begin()); if (insertStart == -1) { -- cgit v1.2.3-freya