summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/Models/filesystemmodel.cpp
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-23 17:34:20 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-23 17:34:20 +1000
commit7aaa14438f7d674707d4b8591364ee457248d0e6 (patch)
tree83c01a7433dd178d3033086c68a91ad10079993b /plugin/src/Caelestia/Models/filesystemmodel.cpp
parentdev: build with clazy (diff)
downloadcaelestia-shell-7aaa14438f7d674707d4b8591364ee457248d0e6.tar.gz
caelestia-shell-7aaa14438f7d674707d4b8591364ee457248d0e6.tar.bz2
caelestia-shell-7aaa14438f7d674707d4b8591364ee457248d0e6.zip
plugin: fix clazy warnings
Diffstat (limited to 'plugin/src/Caelestia/Models/filesystemmodel.cpp')
-rw-r--r--plugin/src/Caelestia/Models/filesystemmodel.cpp12
1 files changed, 6 insertions, 6 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);