1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-13 20:39:57 +01:00

* Refetch cover when underlying metadata changed in PixmapDelegateFader.

This commit is contained in:
Christian Muehlhaeuser 2012-07-06 06:09:21 +02:00
parent 06c5f2e84b
commit d4def82cd1

View File

@ -51,6 +51,7 @@ PixmapDelegateFader::PixmapDelegateFader( const artist_ptr& artist, const QSize&
{
connect( m_artist.data(), SIGNAL( updated() ), SLOT( artistChanged() ) );
connect( m_artist.data(), SIGNAL( coverChanged() ), SLOT( artistChanged() ) );
m_currentReference = m_artist->cover( size, forceLoad );
}
@ -67,6 +68,7 @@ PixmapDelegateFader::PixmapDelegateFader( const album_ptr& album, const QSize& s
{
connect( m_album.data(), SIGNAL( updated() ), SLOT( albumChanged() ) );
connect( m_album.data(), SIGNAL( coverChanged() ), SLOT( albumChanged() ) );
m_currentReference = m_album->cover( size, forceLoad );
}
@ -82,8 +84,10 @@ PixmapDelegateFader::PixmapDelegateFader( const query_ptr& track, const QSize& s
if ( !m_track.isNull() )
{
connect( m_track.data(), SIGNAL( updated() ), SLOT( trackChanged() ) );
connect( m_track.data(), SIGNAL( coverChanged() ), SLOT( trackChanged() ) );
m_currentReference = m_track->cover( size, forceLoad );
connect( m_track.data(), SIGNAL( resultsChanged() ), SLOT( trackChanged() ) );
connect( m_track->displayQuery().data(), SIGNAL( coverChanged() ), SLOT( trackChanged() ) );
m_currentReference = m_track->displayQuery()->cover( size, forceLoad );
}
init();
@ -144,7 +148,7 @@ PixmapDelegateFader::setSize( const QSize& size )
else if ( !m_artist.isNull() )
m_currentReference = m_artist->cover( m_size );
else if ( !m_track.isNull() )
m_currentReference = m_track->cover( m_size );
m_currentReference = m_track->displayQuery()->cover( m_size );
}
emit repaintRequest();
@ -177,7 +181,8 @@ PixmapDelegateFader::trackChanged()
if ( m_track.isNull() )
return;
QMetaObject::invokeMethod( this, "setPixmap", Qt::QueuedConnection, Q_ARG( QPixmap, m_track->cover( m_size ) ) );
connect( m_track->displayQuery().data(), SIGNAL( coverChanged() ), SLOT( trackChanged() ) );
QMetaObject::invokeMethod( this, "setPixmap", Qt::QueuedConnection, Q_ARG( QPixmap, m_track->displayQuery()->cover( m_size ) ) );
}