diff --git a/src/context/contextalbum.cpp b/src/context/contextalbum.cpp index 2107b2ce9..f28975dbd 100644 --- a/src/context/contextalbum.cpp +++ b/src/context/contextalbum.cpp @@ -141,11 +141,7 @@ void ContextAlbum::UpdateWidth(const int new_width) { } -void ContextAlbum::SetImage(QImage image) { - - if (image.isNull()) { - image = image_strawberry_; - } +void ContextAlbum::SetImage(const QImage &image) { if (downloading_covers_) { downloading_covers_ = false; @@ -156,7 +152,13 @@ void ContextAlbum::SetImage(QImage image) { QPixmap pixmap_previous = pixmap_current_; qreal opacity_previous = pixmap_current_opacity_; - image_original_ = image; + if (image.isNull()) { + image_original_ = image_strawberry_; + } + else { + image_original_ = image; + } + pixmap_current_opacity_ = 0.0; ScaleCover(); diff --git a/src/context/contextalbum.h b/src/context/contextalbum.h index 4af2d2115..4944f57d2 100644 --- a/src/context/contextalbum.h +++ b/src/context/contextalbum.h @@ -51,7 +51,7 @@ class ContextAlbum : public QWidget { explicit ContextAlbum(QWidget *parent = nullptr); void Init(ContextView *context_view, AlbumCoverChoiceController *album_cover_choice_controller); - void SetImage(QImage image = QImage()); + void SetImage(const QImage &image = QImage()); void UpdateWidth(const int width); protected: