diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/widget/wcoverart.cpp | 11 | ||||
-rw-r--r-- | src/widget/wcoverart.h | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/widget/wcoverart.cpp b/src/widget/wcoverart.cpp index 6da510f9c3..d6c574c2a7 100644 --- a/src/widget/wcoverart.cpp +++ b/src/widget/wcoverart.cpp @@ -14,14 +14,15 @@ WCoverArt::WCoverArt(QWidget* parent, TrackCollection* pTrackCollection) : QWidget(parent), WBaseWidget(this), - m_defaultCover(scaledCoverArt(CoverArtCache::instance()->getDefaultCoverArt())), + m_pCoverCache(CoverArtCache::instance()), + m_defaultCover(scaledCoverArt(m_pCoverCache->getDefaultCoverArt())), m_bEnableWidget(true), m_pMenu(new WCoverArtMenu(this)), m_loadedCover(m_defaultCover), m_trackDAO(pTrackCollection->getTrackDAO()) { setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - connect(CoverArtCache::instance(), SIGNAL(pixmapFound(int, QPixmap)), + connect(m_pCoverCache, SIGNAL(pixmapFound(int, QPixmap)), this, SLOT(slotPixmapFound(int, QPixmap)), Qt::DirectConnection); connect(m_pMenu, SIGNAL(coverLocationUpdated(const QString&, const QString&, QPixmap)), @@ -62,9 +63,7 @@ void WCoverArt::slotCoverLocationUpdated(const QString& newLoc, QPixmap px) { Q_UNUSED(oldLoc); Q_UNUSED(px); - bool res = CoverArtCache::instance()->changeCoverArt( - m_lastRequestedCover.trackId, newLoc); - if (!res) { + if (!m_pCoverCache->changeCoverArt(m_lastRequestedCover.trackId, newLoc)) { // parent must be NULL - it ensures the use of the default style. QMessageBox::warning(NULL, tr("Change Cover Art"), tr("Could not change the cover art.")); @@ -98,7 +97,7 @@ void WCoverArt::slotLoadCoverArt(CoverInfo info, bool cachedOnly) { return; } m_lastRequestedCover = info; - CoverArtCache::instance()->requestPixmap(info, QSize(0,0), cachedOnly); + m_pCoverCache->requestPixmap(info, QSize(0,0), cachedOnly); } QPixmap WCoverArt::scaledCoverArt(QPixmap normal) { diff --git a/src/widget/wcoverart.h b/src/widget/wcoverart.h index 79630df2c1..9ad16383df 100644 --- a/src/widget/wcoverart.h +++ b/src/widget/wcoverart.h @@ -41,6 +41,7 @@ class WCoverArt : public QWidget, public WBaseWidget { private: QPixmap scaledCoverArt(QPixmap normal); + CoverArtCache* m_pCoverCache; const QPixmap m_defaultCover; bool m_bEnableWidget; WCoverArtMenu* m_pMenu; |