mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
* Detect correct artist() and album() in QueryLabel.
This commit is contained in:
parent
6256ebe91d
commit
d7cf97d4b7
@ -480,3 +480,33 @@ QueryLabel::setType( DisplayType type )
|
||||
updateGeometry();
|
||||
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::query_ptr query() const { return m_query; }
|
||||
Tomahawk::artist_ptr artist() const { return m_artist; }
|
||||
Tomahawk::album_ptr album() const { return m_album; }
|
||||
Tomahawk::artist_ptr artist() const;
|
||||
Tomahawk::album_ptr album() const;
|
||||
|
||||
DisplayType type() const { return m_type; }
|
||||
void setType( DisplayType type );
|
||||
|
Loading…
x
Reference in New Issue
Block a user