Use const reference for AlbumCoverLoaderResult

This commit is contained in:
Jonas Kvinge
2023-04-09 22:26:17 +02:00
parent f8d2c7eba3
commit 2f17647cd3
37 changed files with 242 additions and 309 deletions

View File

@@ -307,7 +307,7 @@ QPixmap RadioModel::ChannelIcon(const QModelIndex &idx) {
}
void RadioModel::AlbumCoverLoaded(const quint64 id, AlbumCoverLoaderResultPtr result) {
void RadioModel::AlbumCoverLoaded(const quint64 id, const AlbumCoverLoaderResult &result) {
if (!pending_art_.contains(id)) return;
@@ -319,11 +319,11 @@ void RadioModel::AlbumCoverLoaded(const quint64 id, AlbumCoverLoaderResultPtr re
pending_cache_keys_.remove(cache_key);
if (!result || !result->success || result->image_scaled.isNull() || result->type == AlbumCoverLoaderResult::Type::ManuallyUnset) {
if (!result.success || result.image_scaled.isNull() || result.type == AlbumCoverLoaderResult::Type::ManuallyUnset) {
QPixmapCache::insert(cache_key, ServiceIcon(item));
}
else {
QPixmapCache::insert(cache_key, QPixmap::fromImage(result->image_scaled));
QPixmapCache::insert(cache_key, QPixmap::fromImage(result.image_scaled));
}
const QModelIndex idx = ItemToIndex(item);