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:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
@@ -116,6 +116,9 @@ protected:
|
||||
|
||||
virtual void startDrag();
|
||||
|
||||
private slots:
|
||||
void onResultChanged();
|
||||
|
||||
private:
|
||||
QString smartAppend( QString& text, const QString& appendage ) const;
|
||||
QTime m_time;
|
||||
|
Reference in New Issue
Block a user