From 7aaa14438f7d674707d4b8591364ee457248d0e6 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 23 Sep 2025 17:34:20 +1000 Subject: plugin: fix clazy warnings --- plugin/src/Caelestia/Models/filesystemmodel.cpp | 12 ++++++------ plugin/src/Caelestia/Models/filesystemmodel.hpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'plugin/src/Caelestia/Models') 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 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& 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& removedPaths, const QSet int insertStart = -1; int prevRow = -1; QList 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: -- cgit v1.2.3-freya