1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 19:14:06 +02:00

yay! we have album covers!

This commit is contained in:
Michael Zanetti
2012-07-05 13:57:27 +02:00
parent 41a37b4690
commit 68de791e8c

View File

@@ -93,18 +93,14 @@ QPixmap DynamicQmlWidget::requestPixmap(const QString &id, QSize *size, const QS
if( size )
*size = QSize( width, height );
QModelIndex index = m_model->index( id.toInt(), 0, QModelIndex() );
QModelIndex index = m_proxyModel->mapToSource( m_proxyModel->index( id.toInt(), 0, QModelIndex() ) );
qDebug() << "!*!*!*! got index" << index << id;
if( index.isValid() ) {
PlayableItem *item = m_model->itemFromIndex( index );
qDebug() << "item:" << item;
qDebug() << "item2:" << item->artistName() << item->name();
if ( !item->album().isNull() ) {
return item->album()->cover( *size );
} else if ( !item->artist().isNull() ) {
return item->artist()->cover( *size );
} else if ( !item->query().isNull() ) {
return item->query()->cover( *size );
if ( !item->query().isNull() ) {
return item->query()->displayQuery()->cover( *size );
}
}