diff --git a/src/libtomahawk/widgets/QueryLabel.cpp b/src/libtomahawk/widgets/QueryLabel.cpp index 64f49d828..0aa645f4d 100644 --- a/src/libtomahawk/widgets/QueryLabel.cpp +++ b/src/libtomahawk/widgets/QueryLabel.cpp @@ -144,11 +144,7 @@ QueryLabel::text() const void QueryLabel::setText( const QString& text ) { - m_result.clear(); - m_query.clear(); - m_artist.clear(); - m_album.clear(); - + clear(); QLabel::setText( m_text ); m_text = text; @@ -160,6 +156,20 @@ QueryLabel::setText( const QString& text ) } +void +QueryLabel::clear() +{ + m_type = None; + + m_result.clear(); + m_query.clear(); + m_artist.clear(); + m_album.clear(); + + QLabel::clear(); +} + + void QueryLabel::onResultChanged() { diff --git a/src/libtomahawk/widgets/QueryLabel.h b/src/libtomahawk/widgets/QueryLabel.h index 54c83ff81..58467c5ba 100644 --- a/src/libtomahawk/widgets/QueryLabel.h +++ b/src/libtomahawk/widgets/QueryLabel.h @@ -70,6 +70,7 @@ public: void init(); public slots: + void clear(); void setText( const QString& text ); void setResult( const Tomahawk::result_ptr& result ); void setQuery( const Tomahawk::query_ptr& query );