summaryrefslogtreecommitdiffstats
path: root/src/library
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-11-12 14:07:01 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-11-12 14:07:01 +0100
commitf50f6765db35357cd0c4060a46f67f486ce0bd69 (patch)
tree65831d01fef967c11878083edd53ef78e54815d5 /src/library
parentcb88ea578a73c8adabb57ce2e1bf10f663d32500 (diff)
Fix a bunch of clazy-range-loop warnings
Diffstat (limited to 'src/library')
-rw-r--r--src/library/autodj/autodjprocessor.cpp2
-rw-r--r--src/library/basesqltablemodel.cpp2
-rw-r--r--src/library/library.cpp5
-rw-r--r--src/library/rekordbox/rekordboxfeature.cpp2
-rw-r--r--src/library/serato/seratofeature.cpp2
-rw-r--r--src/library/trackcollection.cpp2
-rw-r--r--src/library/trackcollectionmanager.cpp8
7 files changed, 11 insertions, 12 deletions
diff --git a/src/library/autodj/autodjprocessor.cpp b/src/library/autodj/autodjprocessor.cpp
index 34a6c99042..5c5ebf2ea8 100644
--- a/src/library/autodj/autodjprocessor.cpp
+++ b/src/library/autodj/autodjprocessor.cpp
@@ -1613,7 +1613,7 @@ DeckAttributes* AutoDJProcessor::getOtherDeck(
}
DeckAttributes* AutoDJProcessor::getFromDeck() {
- for (const auto& pDeck : m_decks) {
+ for (const auto& pDeck : qAsConst(m_decks)) {
if (pDeck->isFromDeck) {
return pDeck;
}
diff --git a/src/library/basesqltablemodel.cpp b/src/library/basesqltablemodel.cpp
index dfd4da4308..ea55ff18ab 100644
--- a/src/library/basesqltablemodel.cpp
+++ b/src/library/basesqltablemodel.cpp
@@ -525,7 +525,7 @@ void BaseSqlTableModel::setSort(int column, Qt::SortOrder order) {
m_sortColumns.prepend(SortColumn(column, order));
} else if (m_trackSource) {
bool first = true;
- for (const SortColumn& sc : m_sortColumns) {
+ for (const SortColumn& sc : qAsConst(m_sortColumns)) {
QString sort_field;
if (sc.m_column < m_tableColumns.size()) {
if (sc.m_column == kIdColumn) {
diff --git a/src/library/library.cpp b/src/library/library.cpp
index e82533df1a..657f7a0fee 100644
--- a/src/library/library.cpp
+++ b/src/library/library.cpp
@@ -283,8 +283,7 @@ void Library::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) {
pSidebarWidget,
&WLibrarySidebar::slotSetFont);
-
- for (const auto& feature : m_features) {
+ for (const auto& feature : qAsConst(m_features)) {
feature->bindSidebarWidget(pSidebarWidget);
}
}
@@ -338,7 +337,7 @@ void Library::bindLibraryWidget(WLibrary* pLibraryWidget,
m_pLibraryControl->bindLibraryWidget(pLibraryWidget, pKeyboard);
- for (const auto& feature : m_features) {
+ for (const auto& feature : qAsConst(m_features)) {
feature->bindLibraryWidget(pLibraryWidget, pKeyboard);
}
diff --git a/src/library/rekordbox/rekordboxfeature.cpp b/src/library/rekordbox/rekordboxfeature.cpp
index 7f80d9de24..27488afadb 100644
--- a/src/library/rekordbox/rekordboxfeature.cpp
+++ b/src/library/rekordbox/rekordboxfeature.cpp
@@ -1357,7 +1357,7 @@ QString RekordboxFeature::formatRootViewHtml() const {
html.append(QString("<h2>%1</h2>").arg(title));
html.append(QString("<p>%1</p>").arg(summary));
html.append(QString("<ul>"));
- for (const auto& item : items) {
+ for (const auto& item : qAsConst(items)) {
html.append(QString("<li>%1</li>").arg(item));
}
html.append(QString("</ul>"));
diff --git a/src/library/serato/seratofeature.cpp b/src/library/serato/seratofeature.cpp
index 8f4e6febd7..cc060706c1 100644
--- a/src/library/serato/seratofeature.cpp
+++ b/src/library/serato/seratofeature.cpp
@@ -987,7 +987,7 @@ QString SeratoFeature::formatRootViewHtml() const {
html.append(QString("<h2>%1</h2>").arg(title));
html.append(QString("<p>%1</p>").arg(summary));
html.append(QString("<ul>"));
- for (const auto& item : items) {
+ for (const auto& item : qAsConst(items)) {
html.append(QString("<li>%1</li>").arg(item));
}
html.append(QString("</ul>"));
diff --git a/src/library/trackcollection.cpp b/src/library/trackcollection.cpp
index 82d2a25f95..eab6859332 100644
--- a/src/library/trackcollection.cpp
+++ b/src/library/trackcollection.cpp
@@ -246,7 +246,7 @@ bool TrackCollection::hideTracks(const QList<TrackId>& trackIds) {
for (const auto& trackId: trackIds) {
QSet<int> playlistIds;
m_playlistDao.getPlaylistsTrackIsIn(trackId, &playlistIds);
- for (const auto& playlistId: playlistIds) {
+ for (const auto& playlistId : qAsConst(playlistIds)) {
if (m_playlistDao.getHiddenType(playlistId) != PlaylistDAO::PLHT_SET_LOG) {
allPlaylistIds.insert(playlistId);
}
diff --git a/src/library/trackcollectionmanager.cpp b/src/library/trackcollectionmanager.cpp
index 6717924675..ead9ab786a 100644
--- a/src/library/trackcollectionmanager.cpp
+++ b/src/library/trackcollectionmanager.cpp
@@ -55,7 +55,7 @@ TrackCollectionManager::TrackCollectionManager(
} else {
// TODO: Add external collections
}
- for (const auto& externalCollection : m_externalCollections) {
+ for (const auto& externalCollection : qAsConst(m_externalCollections)) {
kLogger.info()
<< "Connecting to"
<< externalCollection->name();
@@ -147,7 +147,7 @@ TrackCollectionManager::~TrackCollectionManager() {
// components are accessing those files at this point.
GlobalTrackCacheLocker().deactivateCache();
- for (const auto& externalCollection : m_externalCollections) {
+ for (const auto& externalCollection : qAsConst(m_externalCollections)) {
kLogger.info()
<< "Disconnecting from"
<< externalCollection->name();
@@ -228,7 +228,7 @@ void TrackCollectionManager::saveTrack(
<< "in"
<< m_externalCollections.size()
<< "external collection(s)";
- for (const auto& externalTrackCollection : m_externalCollections) {
+ for (const auto& externalTrackCollection : qAsConst(m_externalCollections)) {
externalTrackCollection->saveTrack(
*pTrack,
ExternalTrackCollection::ChangeHint::Modified);
@@ -243,7 +243,7 @@ void TrackCollectionManager::saveTrack(
<< "from"
<< m_externalCollections.size()
<< "external collection(s)";
- for (const auto& externalTrackCollection : m_externalCollections) {
+ for (const auto& externalTrackCollection : qAsConst(m_externalCollections)) {
externalTrackCollection->purgeTracks(
QStringList{pTrack->getLocation()});
}