summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/library/coverartcache.cpp9
-rw-r--r--src/library/coverartcache.h5
2 files changed, 8 insertions, 6 deletions
diff --git a/src/library/coverartcache.cpp b/src/library/coverartcache.cpp
index fff0eaf67c..eb1ba69a89 100644
--- a/src/library/coverartcache.cpp
+++ b/src/library/coverartcache.cpp
@@ -12,7 +12,8 @@ CoverArtCache::CoverArtCache()
: m_pCoverArtDAO(NULL),
m_pTrackDAO(NULL),
m_sDefaultCoverLocation(":/images/library/default_cover.png"),
- m_defaultCover(m_sDefaultCoverLocation) {
+ m_imgDefaultCover(m_sDefaultCoverLocation),
+ m_pxDefaultCover(m_sDefaultCoverLocation) {
// The initial QPixmapCache limit is 10MB.
// But it is not used just by the coverArt stuff,
// it is also used by Qt to handle other things behind the scenes.
@@ -203,7 +204,7 @@ void CoverArtCache::imageLoaded() {
// The widgets expects a signal response.
if (pixmap.isNull()) {
- pixmap = m_defaultCover;
+ pixmap = m_pxDefaultCover;
}
if (res.issueRepaint) {
@@ -246,7 +247,7 @@ CoverArtCache::FutureResult CoverArtCache::searchImage(
if (res.img.isNull()) {
res.coverLocation = m_sDefaultCoverLocation;
- res.img = QImage(m_sDefaultCoverLocation);
+ res.img = m_imgDefaultCover;
}
res.md5Hash = calculateMD5(res.img);
@@ -351,7 +352,7 @@ void CoverArtCache::imageFound() {
// The widgets expects a signal response.
if (pixmap.isNull()) {
- pixmap = m_defaultCover;
+ pixmap = m_pxDefaultCover;
}
if (res.issueRepaint) {
diff --git a/src/library/coverartcache.h b/src/library/coverartcache.h
index f2b94abe85..80bfc3a5b9 100644
--- a/src/library/coverartcache.h
+++ b/src/library/coverartcache.h
@@ -48,7 +48,7 @@ class CoverArtCache : public QObject, public Singleton<CoverArtCache>
void setTrackDAO(TrackDAO* trackdao);
QString getDefaultCoverLocation() { return m_sDefaultCoverLocation; }
- QPixmap getDefaultCoverArt() { return m_defaultCover; }
+ QPixmap getDefaultCoverArt() { return m_pxDefaultCover; }
// This is for widgets that try to get the covers directly from the cache
// instead of waiting for the signal with the cover. Because we update the
// database in large batches it can happen that a widget looks up a track
@@ -97,7 +97,8 @@ class CoverArtCache : public QObject, public Singleton<CoverArtCache>
CoverArtDAO* m_pCoverArtDAO;
TrackDAO* m_pTrackDAO;
const QString m_sDefaultCoverLocation;
- const QPixmap m_defaultCover;
+ const QImage m_imgDefaultCover;
+ const QPixmap m_pxDefaultCover;
QSet<int> m_runningIds;
QHash<int, QPair<QString, QString> > m_queueOfUpdates;