From 4b1e71bc6bcafcf5004de4c7f894c6b4ad0b329e Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 23 Oct 2010 10:27:40 +0200 Subject: [PATCH] * Fix resolving queries via the web-API. --- include/tomahawk/query.h | 12 +----------- src/query.cpp | 15 +++++++++++++++ src/web/api_v1.h | 1 - 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/include/tomahawk/query.h b/include/tomahawk/query.h index 04c2af790..f92c84384 100644 --- a/include/tomahawk/query.h +++ b/include/tomahawk/query.h @@ -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; } diff --git a/src/query.cpp b/src/query.cpp index d04c2fcb3..409db7a1b 100644 --- a/src/query.cpp +++ b/src/query.cpp @@ -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 ) { diff --git a/src/web/api_v1.h b/src/web/api_v1.h index 975d85735..89b65b822 100644 --- a/src/web/api_v1.h +++ b/src/web/api_v1.h @@ -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 );