1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 22:26:32 +02:00

* Update QueryLabel when underlying result changes.

This commit is contained in:
Christian Muehlhaeuser
2012-11-16 07:13:01 +01:00
parent 4902bac904
commit 11483d22ec
2 changed files with 18 additions and 6 deletions

View File

@@ -179,6 +179,19 @@ QueryLabel::setText( const QString& text )
}
void
QueryLabel::onResultChanged()
{
m_query = m_result->toQuery();
m_artist = m_result->artist();
m_album = m_result->album();
updateLabel();
emit textChanged( text() );
}
void
QueryLabel::setResult( const Tomahawk::result_ptr& result )
{
@@ -193,13 +206,9 @@ QueryLabel::setResult( const Tomahawk::result_ptr& result )
if ( m_result.isNull() || m_result.data() != result.data() )
{
m_result = result;
m_query = m_result->toQuery();
m_artist = result->artist();
m_album = result->album();
connect( m_result.data(), SIGNAL( updated() ), SLOT( onResultChanged() ) );
updateLabel();
emit textChanged( text() );
onResultChanged();
emit resultChanged( m_result );
}
}

View File

@@ -116,6 +116,9 @@ protected:
virtual void startDrag();
private slots:
void onResultChanged();
private:
QString smartAppend( QString& text, const QString& appendage ) const;
QTime m_time;