diff --git a/models/mpdlibrarymodel.cpp b/models/mpdlibrarymodel.cpp index 7e24e876e..4b879eb85 100644 --- a/models/mpdlibrarymodel.cpp +++ b/models/mpdlibrarymodel.cpp @@ -32,6 +32,7 @@ #include GLOBAL_STATIC(MpdLibraryModel, instance) +#define COVERS_DBUG if (Covers::verboseDebugEnabled()) qWarning() << metaObject()->className() << QThread::currentThread()->objectName() << __FUNCTION__ MpdLibraryModel::MpdLibraryModel() : SqlLibraryModel(new MpdLibraryDb(0), 0) @@ -61,11 +62,13 @@ QVariant MpdLibraryModel::data(const QModelIndex &index, int role) const case Cantata::Role_CoverSong: { QVariant v; Item *item = static_cast(index.internalPointer()); + COVERS_DBUG << index.data().toString() << item->getType() << role; switch (item->getType()) { case T_Album: if (item->getSong().isEmpty()) { Song song=static_cast(db)->getCoverSong(T_Album==topLevel() ? static_cast(item)->getArtistId() : item->getParent()->getId(), item->getId()); item->setSong(song); + COVERS_DBUG << "Set album cover song" << song.albumArtist() << song.album << song.file; if (T_Genre==topLevel()) { song.addGenre(item->getParent()->getParent()->getId()); } @@ -74,10 +77,12 @@ QVariant MpdLibraryModel::data(const QModelIndex &index, int role) const break; case T_Artist: if (!showArtistImages && Cantata::Role_CoverSong==role) { + COVERS_DBUG << "Not showing artist images"; return QVariant(); } if (item->getSong().isEmpty()) { Song song=static_cast(db)->getCoverSong(item->getId()); + COVERS_DBUG << "Set artist cover song" << song.albumArtist() << song.album << song.file; if (song.useComposer()) { song.setComposerImageRequest(); } else { diff --git a/widgets/itemview.cpp b/widgets/itemview.cpp index 7feb8c55c..aa45d7876 100644 --- a/widgets/itemview.cpp +++ b/widgets/itemview.cpp @@ -50,7 +50,7 @@ #include #include -#define DBUG if (Covers::verboseDebugEnabled()) qWarning() << metaObject()->className() << QThread::currentThread()->objectName() << __FUNCTION__ +#define COVERS_DBUG if (Covers::verboseDebugEnabled()) qWarning() << metaObject()->className() << QThread::currentThread()->objectName() << __FUNCTION__ static int detailedViewDecorationSize=22; static int simpleViewDecorationSize=16; @@ -236,7 +236,7 @@ public: } if (pix.isNull() && (iconMode || index.data(Cantata::Role_ListImage).toBool())) { Song cSong=index.data(iconMode ? Cantata::Role_GridCoverSong : Cantata::Role_CoverSong).value(); - DBUG << "Cover song" << cSong.albumArtist() << cSong.album << cSong.file; + COVERS_DBUG << "Cover song" << cSong.albumArtist() << cSong.album << cSong.file << index.data().toString() << iconMode; if (!cSong.isEmpty()) { QPixmap *cp=Covers::self()->get(cSong, iconMode ? zoomedSize(view, gridCoverSize) : listCoverSize, getCoverInUiThread(index)); if (cp) { @@ -245,7 +245,7 @@ public: } } if (pix.isNull()) { - DBUG << "No cover image, use decoration"; + COVERS_DBUG << "No cover image, use decoration"; int size=iconMode ? zoomedSize(view, gridCoverSize) : detailedViewDecorationSize; pix=index.data(Qt::DecorationRole).value().pixmap(size, size, selected && textColor==qApp->palette().color(QPalette::HighlightedText)