mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Detect correct artist() and album() in QueryLabel.
This commit is contained in:
@@ -480,3 +480,33 @@ QueryLabel::setType( DisplayType type )
|
|||||||
updateGeometry();
|
updateGeometry();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Tomahawk::artist_ptr
|
||||||
|
QueryLabel::artist() const
|
||||||
|
{
|
||||||
|
if ( m_artist )
|
||||||
|
return m_artist;
|
||||||
|
else if ( m_album )
|
||||||
|
return m_album->artist();
|
||||||
|
else if ( m_result )
|
||||||
|
return m_result->track()->artistPtr();
|
||||||
|
else if ( m_query )
|
||||||
|
return m_query->track()->artistPtr();
|
||||||
|
|
||||||
|
return artist_ptr();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Tomahawk::album_ptr
|
||||||
|
QueryLabel::album() const
|
||||||
|
{
|
||||||
|
if ( m_album )
|
||||||
|
return m_album;
|
||||||
|
else if ( m_result )
|
||||||
|
return m_result->track()->albumPtr();
|
||||||
|
else if ( m_query )
|
||||||
|
return m_query->track()->albumPtr();
|
||||||
|
|
||||||
|
return album_ptr();
|
||||||
|
}
|
||||||
|
@@ -55,8 +55,8 @@ public:
|
|||||||
|
|
||||||
Tomahawk::result_ptr result() const { return m_result; }
|
Tomahawk::result_ptr result() const { return m_result; }
|
||||||
Tomahawk::query_ptr query() const { return m_query; }
|
Tomahawk::query_ptr query() const { return m_query; }
|
||||||
Tomahawk::artist_ptr artist() const { return m_artist; }
|
Tomahawk::artist_ptr artist() const;
|
||||||
Tomahawk::album_ptr album() const { return m_album; }
|
Tomahawk::album_ptr album() const;
|
||||||
|
|
||||||
DisplayType type() const { return m_type; }
|
DisplayType type() const { return m_type; }
|
||||||
void setType( DisplayType type );
|
void setType( DisplayType type );
|
||||||
|
Reference in New Issue
Block a user