1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

* Fix resolving queries via the web-API.

This commit is contained in:
Christian Muehlhaeuser
2010-10-23 10:27:40 +02:00
parent cd118208e8
commit 4b1e71bc6b
3 changed files with 16 additions and 12 deletions

View File

@@ -18,17 +18,7 @@ class Query : public QObject
Q_OBJECT
public:
explicit Query( const QVariant& v )
: m_v( v )
, m_solved( false )
{
// ensure a QID is present:
QVariantMap m = m_v.toMap();
m_artist = m.value( "artist" ).toString();
m_album = m.value( "album" ).toString();
m_track = m.value( "track" ).toString();
}
explicit Query( const QVariant& v );
QVariant toVariant() const { return m_v; }

View File

@@ -4,6 +4,21 @@
using namespace Tomahawk;
Query::Query( const QVariant& v )
: m_v( v )
, m_solved( false )
{
// ensure a QID is present:
QVariantMap m = m_v.toMap();
m_artist = m.value( "artist" ).toString();
m_album = m.value( "album" ).toString();
m_track = m.value( "track" ).toString();
m_qid = m.value( "qid" ).toString();
}
void
Query::addResults( const QList< Tomahawk::result_ptr >& newresults )
{

View File

@@ -44,7 +44,6 @@ public slots:
if( method == "stat" ) return stat(event);
if( method == "resolve" ) return resolve(event);
if( method == "get_results" ) return get_results(event);
}
send404( event );