ContextAlbum: Use const reference for image parameter
This commit is contained in:
parent
05f012e590
commit
6177d4a2c4
|
@ -141,11 +141,7 @@ void ContextAlbum::UpdateWidth(const int new_width) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContextAlbum::SetImage(QImage image) {
|
void ContextAlbum::SetImage(const QImage &image) {
|
||||||
|
|
||||||
if (image.isNull()) {
|
|
||||||
image = image_strawberry_;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (downloading_covers_) {
|
if (downloading_covers_) {
|
||||||
downloading_covers_ = false;
|
downloading_covers_ = false;
|
||||||
|
@ -156,7 +152,13 @@ void ContextAlbum::SetImage(QImage image) {
|
||||||
QPixmap pixmap_previous = pixmap_current_;
|
QPixmap pixmap_previous = pixmap_current_;
|
||||||
qreal opacity_previous = pixmap_current_opacity_;
|
qreal opacity_previous = pixmap_current_opacity_;
|
||||||
|
|
||||||
|
if (image.isNull()) {
|
||||||
|
image_original_ = image_strawberry_;
|
||||||
|
}
|
||||||
|
else {
|
||||||
image_original_ = image;
|
image_original_ = image;
|
||||||
|
}
|
||||||
|
|
||||||
pixmap_current_opacity_ = 0.0;
|
pixmap_current_opacity_ = 0.0;
|
||||||
ScaleCover();
|
ScaleCover();
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ class ContextAlbum : public QWidget {
|
||||||
explicit ContextAlbum(QWidget *parent = nullptr);
|
explicit ContextAlbum(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void Init(ContextView *context_view, AlbumCoverChoiceController *album_cover_choice_controller);
|
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);
|
void UpdateWidth(const int width);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in New Issue