mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +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
|
void
|
||||||
QueryLabel::setResult( const Tomahawk::result_ptr& result )
|
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() )
|
if ( m_result.isNull() || m_result.data() != result.data() )
|
||||||
{
|
{
|
||||||
m_result = result;
|
m_result = result;
|
||||||
m_query = m_result->toQuery();
|
connect( m_result.data(), SIGNAL( updated() ), SLOT( onResultChanged() ) );
|
||||||
m_artist = result->artist();
|
|
||||||
m_album = result->album();
|
|
||||||
|
|
||||||
updateLabel();
|
onResultChanged();
|
||||||
|
|
||||||
emit textChanged( text() );
|
|
||||||
emit resultChanged( m_result );
|
emit resultChanged( m_result );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -116,6 +116,9 @@ protected:
|
|||||||
|
|
||||||
virtual void startDrag();
|
virtual void startDrag();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void onResultChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString smartAppend( QString& text, const QString& appendage ) const;
|
QString smartAppend( QString& text, const QString& appendage ) const;
|
||||||
QTime m_time;
|
QTime m_time;
|
||||||
|
Reference in New Issue
Block a user