diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-23 17:34:20 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-23 17:34:20 +1000 |
| commit | 7aaa14438f7d674707d4b8591364ee457248d0e6 (patch) | |
| tree | 83c01a7433dd178d3033086c68a91ad10079993b /plugin/src/Caelestia/Models | |
| parent | dev: build with clazy (diff) | |
| download | caelestia-shell-7aaa14438f7d674707d4b8591364ee457248d0e6.tar.gz caelestia-shell-7aaa14438f7d674707d4b8591364ee457248d0e6.tar.bz2 caelestia-shell-7aaa14438f7d674707d4b8591364ee457248d0e6.zip | |
plugin: fix clazy warnings
Diffstat (limited to 'plugin/src/Caelestia/Models')
| -rw-r--r-- | plugin/src/Caelestia/Models/filesystemmodel.cpp | 12 | ||||
| -rw-r--r-- | plugin/src/Caelestia/Models/filesystemmodel.hpp | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/plugin/src/Caelestia/Models/filesystemmodel.cpp b/plugin/src/Caelestia/Models/filesystemmodel.cpp index 9cebaec..0eadebb 100644 --- a/plugin/src/Caelestia/Models/filesystemmodel.cpp +++ b/plugin/src/Caelestia/Models/filesystemmodel.cpp @@ -114,7 +114,7 @@ void FileSystemModel::setPath(const QString& path) { m_dir.setPath(m_path); - for (const auto& entry : m_entries) { + for (const auto& entry : std::as_const(m_entries)) { entry->updateRelativePath(m_dir); } @@ -292,10 +292,9 @@ void FileSystemModel::updateEntriesForDir(const QString& dir) { const auto showHidden = m_showHidden; const auto filter = m_filter; const auto nameFilters = m_nameFilters; - const auto baseDir = m_dir; QSet<QString> oldPaths; - for (const auto& entry : m_entries) { + for (const auto& entry : std::as_const(m_entries)) { oldPaths << entry->path(); } @@ -306,7 +305,8 @@ void FileSystemModel::updateEntriesForDir(const QString& dir) { if (filter == Images) { QStringList extraNameFilters = nameFilters; - for (const auto& format : QImageReader::supportedImageFormats()) { + const auto formats = QImageReader::supportedImageFormats(); + for (const auto& format : formats) { extraNameFilters << "*." + format; } @@ -400,7 +400,7 @@ void FileSystemModel::applyChanges(const QSet<QString>& removedPaths, const QSet int start = -1; int end = -1; - for (int idx : removedIndices) { + for (int idx : std::as_const(removedIndices)) { if (start == -1) { start = idx; end = idx; @@ -438,7 +438,7 @@ void FileSystemModel::applyChanges(const QSet<QString>& removedPaths, const QSet int insertStart = -1; int prevRow = -1; QList<FileSystemEntry*> batchItems; - for (const auto& entry : newEntries) { + for (const auto& entry : std::as_const(newEntries)) { const auto it = std::lower_bound( m_entries.begin(), m_entries.end(), entry, [this](const FileSystemEntry* a, const FileSystemEntry* b) { return compareEntries(a, b); diff --git a/plugin/src/Caelestia/Models/filesystemmodel.hpp b/plugin/src/Caelestia/Models/filesystemmodel.hpp index 07fb1a1..822babd 100644 --- a/plugin/src/Caelestia/Models/filesystemmodel.hpp +++ b/plugin/src/Caelestia/Models/filesystemmodel.hpp @@ -121,7 +121,7 @@ signals: void nameFiltersChanged(); void entriesChanged(); - void added(const FileSystemEntry* entry); + void added(const caelestia::FileSystemEntry* entry); void removed(const QString& path); private: |