From 8df3449df80562a23dfd59da0103d8180a2effc7 Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Fri, 7 Mar 2014 17:17:10 +0000 Subject: [PATCH] Background update imrovements --- context/contextwidget.cpp | 14 +++++--------- context/contextwidget.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/context/contextwidget.cpp b/context/contextwidget.cpp index 0072e5418..ac3c49026 100644 --- a/context/contextwidget.cpp +++ b/context/contextwidget.cpp @@ -462,18 +462,14 @@ void ContextWidget::readConfig() switch (backdropType) { case PlayQueueView::BI_None: if (origType!=backdropType && isVisible() && !currentArtist.isEmpty()) { - updateArtist=currentArtist; - currentArtist.clear(); - updateBackdrop(); + updateBackdrop(true); QWidget::update(); } break; case PlayQueueView::BI_Cover: if (origType!=backdropType || backdropOpacity!=origOpacity || backdropBlur!=origBlur) { if (isVisible() && !currentArtist.isEmpty()) { - updateArtist=currentArtist; - currentArtist.clear(); - updateBackdrop(); + updateBackdrop(true); QWidget::update(); } } @@ -692,10 +688,10 @@ void ContextWidget::cancel() } } -void ContextWidget::updateBackdrop() +void ContextWidget::updateBackdrop(bool force) { - DBUG << updateArtist << currentArtist << currentSong.file; - if (updateArtist==currentArtist) { + DBUG << updateArtist << currentArtist << currentSong.file << force; + if (!force && updateArtist==currentArtist) { return; } currentArtist=updateArtist; diff --git a/context/contextwidget.h b/context/contextwidget.h index 8f60fe7a3..fee911389 100644 --- a/context/contextwidget.h +++ b/context/contextwidget.h @@ -131,7 +131,7 @@ private: void resizeEvent(QResizeEvent *e); bool eventFilter(QObject *o, QEvent *e); void cancel(); - void updateBackdrop(); + void updateBackdrop(bool force=false); void getBackdrop(); void getFanArtBackdrop(); void getMusicbrainzId(const QString &artist);