No need to delete pixmap cache when deleting empty parents
This commit is contained in:
parent
bc0c50ee65
commit
c8d580e7de
|
@ -434,8 +434,9 @@ void CollectionModel::SongsDeleted(const SongList &songs) {
|
|||
|
||||
if (node->parent != root_) parents << node->parent;
|
||||
|
||||
// Remove from pixmap cache
|
||||
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);
|
||||
|
@ -486,22 +487,6 @@ void CollectionModel::SongsDeleted(const SongList &songs) {
|
|||
else
|
||||
container_nodes_[node->container_level].remove(node->key);
|
||||
|
||||
// Remove from pixmap cache
|
||||
QModelIndex idx = ItemToIndex(node->parent);
|
||||
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
|
||||
QMapIterator<quint64, ItemAndCacheKey> i(pending_art_);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
if (i.value().first == node) {
|
||||
pending_art_.remove(i.key());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// It was empty - delete it
|
||||
beginRemoveRows(ItemToIndex(node->parent), node->row, node->row);
|
||||
node->parent->Delete(node->row);
|
||||
|
|
Loading…
Reference in New Issue