Fix TryLoadPixmap and ShowCover

This commit is contained in:
Jonas Kvinge
2019-07-09 01:05:42 +02:00
parent e11958dd58
commit f94a3095fd
3 changed files with 20 additions and 23 deletions

View File

@@ -256,14 +256,11 @@ void AlbumCoverChoiceController::ShowCover(const Song &song) {
}
void AlbumCoverChoiceController::ShowCover(const Song &song, const QImage image) {
void AlbumCoverChoiceController::ShowCover(const Song &song, const QImage &image) {
QUrl url_manual(song.art_manual());
QUrl url_automatic(song.art_automatic());
if (url_manual.isLocalFile() || url_automatic.isLocalFile()) {
if (song.art_manual().isLocalFile() || song.art_automatic().isLocalFile()) {
QPixmap pixmap = AlbumCoverLoader::TryLoadPixmap(song.art_automatic(), song.art_manual(), song.url().toLocalFile());
ShowCover(song, pixmap);
if (!pixmap.isNull()) ShowCover(song, pixmap);
}
else if (!image.isNull()) ShowCover(song, QPixmap::fromImage(image));