diff --git a/src/collection/collectionmodel.cpp b/src/collection/collectionmodel.cpp index e5a683fe7..3c49baf61 100644 --- a/src/collection/collectionmodel.cpp +++ b/src/collection/collectionmodel.cpp @@ -568,13 +568,12 @@ void CollectionModel::SongsDeleted(const SongList &songs) { } // Remove from pending art loading - QMap::iterator i = pending_art_.begin(); - while (i != pending_art_.end()) { - if (i.value().first == node) { - i = pending_art_.erase(i); // clazy:exclude=strict-iterators + for (QMap::iterator it = pending_art_.begin() ; it != pending_art_.end();) { + if (it.value().first == node) { + it = pending_art_.erase(it); // clazy:exclude=strict-iterators } else { - ++i; + ++it; } } diff --git a/src/context/contextalbumsmodel.cpp b/src/context/contextalbumsmodel.cpp index e7f1364af..5c319f112 100644 --- a/src/context/contextalbumsmodel.cpp +++ b/src/context/contextalbumsmodel.cpp @@ -314,11 +314,9 @@ void ContextAlbumsModel::LazyPopulate(CollectionItem *parent, const bool signal) void ContextAlbumsModel::Reset() { - QMap::iterator i = container_nodes_.begin(); - while (i != container_nodes_.end()) { - const QString cache_key = AlbumIconPixmapCacheKey(ItemToIndex(i.value())); + for (QMap::const_iterator it = container_nodes_.begin() ; it != container_nodes_.end(); ++it) { + const QString cache_key = AlbumIconPixmapCacheKey(ItemToIndex(it.value())); QPixmapCache::remove(cache_key); - ++i; } beginResetModel();