mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 09:04:33 +02:00
* Update dashboard header image instantly.
This commit is contained in:
@@ -153,10 +153,24 @@ ContextView::setCaption( const QString& caption )
|
||||
void
|
||||
ContextView::onQuerySelected( const Tomahawk::query_ptr& query )
|
||||
{
|
||||
if ( query->track()->cover( QSize( 0, 0 ) ).isNull() )
|
||||
if ( m_query )
|
||||
{
|
||||
disconnect( m_query->track().data(), SIGNAL( updated() ), this, SLOT( onCoverUpdated() ) );
|
||||
}
|
||||
|
||||
m_query = query;
|
||||
connect( m_query->track().data(), SIGNAL( updated() ), SLOT( onCoverUpdated() ) );
|
||||
onCoverUpdated();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ContextView::onCoverUpdated()
|
||||
{
|
||||
if ( m_query->track()->cover( QSize( 0, 0 ) ).isNull() )
|
||||
return;
|
||||
|
||||
m_pixmap = query->track()->cover( QSize( 0, 0 ) );
|
||||
m_pixmap = m_query->track()->cover( QSize( 0, 0 ) );
|
||||
emit pixmapChanged( m_pixmap );
|
||||
}
|
||||
|
||||
|
@@ -82,6 +82,7 @@ private slots:
|
||||
void onWidgetDestroyed( QWidget* widget );
|
||||
|
||||
void onQuerySelected( const Tomahawk::query_ptr& query );
|
||||
void onCoverUpdated();
|
||||
|
||||
private:
|
||||
FilterHeader* m_header;
|
||||
@@ -94,6 +95,8 @@ private:
|
||||
PlayableModel* m_model;
|
||||
QStackedWidget* m_stack;
|
||||
|
||||
Tomahawk::query_ptr m_query;
|
||||
|
||||
bool m_temporary;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user