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