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

@@ -96,15 +96,15 @@ void StandardItemIconLoader::ModelReset() {
}
void StandardItemIconLoader::AlbumCoverLoaded(const quint64 id, AlbumCoverLoaderResultPtr result) {
void StandardItemIconLoader::AlbumCoverLoaded(const quint64 id, const AlbumCoverLoaderResult &result) {
if (!pending_covers_.contains(id)) return;
QStandardItem *item = pending_covers_.take(id);
if (!item) return;
if (result && result->success && !result->image_scaled.isNull() && result->type != AlbumCoverLoaderResult::Type::ManuallyUnset) {
item->setIcon(QIcon(QPixmap::fromImage(result->image_scaled)));
if (result.success && !result.image_scaled.isNull() && result.type != AlbumCoverLoaderResult::Type::ManuallyUnset) {
item->setIcon(QIcon(QPixmap::fromImage(result.image_scaled)));
}
}