From 722a088515b7814a6446ba18a7b1109436f68996 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 26 Nov 2019 19:42:05 +0100 Subject: [PATCH] Only remove pixmap cache when removing parents in collection model --- src/collection/collectionmodel.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/collection/collectionmodel.cpp b/src/collection/collectionmodel.cpp index 944fe537d..b206fb627 100644 --- a/src/collection/collectionmodel.cpp +++ b/src/collection/collectionmodel.cpp @@ -435,27 +435,7 @@ void CollectionModel::SongsDeleted(const SongList &songs) { if (node->parent != root_) parents << node->parent; - QModelIndex idx = ItemToIndex(node->parent); - - // Remove from pixmap cache - const QString cache_key = AlbumIconPixmapCacheKey(idx); - QPixmapCache::remove(cache_key); - if (pending_cache_keys_.contains(cache_key)) { - pending_cache_keys_.remove(cache_key); - } - - // Remove from pending art loading - QMap::iterator i = pending_art_.begin(); - while (i != pending_art_.end()) { - if (i.value().first == node->parent) { - i = pending_art_.erase(i); - } - else { - ++i; - } - } - - beginRemoveRows(idx, node->row, node->row); + beginRemoveRows(ItemToIndex(node->parent), node->row, node->row); node->parent->Delete(node->row); song_nodes_.remove(song.id()); endRemoveRows();