diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-22 21:40:34 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-22 21:40:34 +1000 |
| commit | 5ff544ceabf7b770e6f04adb3df05a6746508e0f (patch) | |
| tree | 105014ccb91492c7c946127d7a8233c23522be0c /plugin/src | |
| parent | lock: different error messages (diff) | |
| download | caelestia-shell-5ff544ceabf7b770e6f04adb3df05a6746508e0f.tar.gz caelestia-shell-5ff544ceabf7b770e6f04adb3df05a6746508e0f.tar.bz2 caelestia-shell-5ff544ceabf7b770e6f04adb3df05a6746508e0f.zip | |
plugin/fsm: dont store comparator
Diffstat (limited to '')
| -rw-r--r-- | plugin/src/Caelestia/Models/filesystemmodel.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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<QString>& 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<FileSystemEntry*> 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<int>(it - m_entries.begin()); if (insertStart == -1) { |