1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-10-04 09:31:41 +02:00

* Introduced Query::displayQuery(). Returns (if available) the first result as a query_ptr, otherwise returns the Query's own query_ptr. Use this whenever you wanna display Query stuff in the GUI. Also, reduce numResults() usage.

This commit is contained in:
Christian Muehlhaeuser
2012-05-20 10:39:05 +02:00
parent d3271cffde
commit 5ed65cafce
18 changed files with 104 additions and 174 deletions

View File

@@ -163,12 +163,7 @@ Result::toVariant() const
m.insert( "artist", artist()->name() );
m.insert( "album", album()->name() );
m.insert( "track", track() );
if ( !collection().isNull() )
m.insert( "source", collection()->source()->friendlyName() );
else
m.insert( "source", friendlySource() );
m.insert( "source", friendlySource() );
m.insert( "mimetype", mimetype() );
m.insert( "size", size() );
m.insert( "bitrate", bitrate() );
@@ -176,6 +171,7 @@ Result::toVariant() const
m.insert( "score", score() );
m.insert( "sid", id() );
m.insert( "discnumber", discnumber() );
m.insert( "albumpos", albumpos() );
if ( !composer().isNull() )
m.insert( "composer", composer()->name() );
@@ -197,6 +193,12 @@ Result::toQuery()
if ( m_query.isNull() )
{
m_query = Tomahawk::Query::get( artist()->name(), track(), album()->name() );
m_query->setAlbumPos( albumpos() );
m_query->setDiscNumber( discnumber() );
m_query->setDuration( duration() );
if ( !composer().isNull() )
m_query->setComposer( composer()->name() );
QList<Tomahawk::result_ptr> rl;
rl << Result::get( m_url );