1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 13:47:26 +02:00

* Notify results about their originating resolver.

This commit is contained in:
Christian Muehlhaeuser
2012-06-07 10:43:26 +02:00
parent 07660c3f81
commit f89f119078
3 changed files with 12 additions and 3 deletions

View File

@@ -54,7 +54,10 @@ DatabaseResolver::resolve( const Tomahawk::query_ptr& query )
void void
DatabaseResolver::gotResults( const Tomahawk::QID qid, QList< Tomahawk::result_ptr> results ) DatabaseResolver::gotResults( const Tomahawk::QID qid, QList< Tomahawk::result_ptr> results )
{ {
qDebug() << Q_FUNC_INFO << qid << results.length(); tDebug( LOGVERBOSE ) << Q_FUNC_INFO << qid << results.length();
foreach ( const Tomahawk::result_ptr& r, results )
r->setResolvedBy( this );
Tomahawk::Pipeline::instance()->reportResults( qid, results ); Tomahawk::Pipeline::instance()->reportResults( qid, results );
} }

View File

@@ -131,6 +131,7 @@ QtScriptResolverHelper::setResolverConfig( const QVariantMap& config )
m_resolverConfig = config; m_resolverConfig = config;
} }
QString QString
QtScriptResolverHelper::hmac( const QByteArray& key, const QByteArray &input ) QtScriptResolverHelper::hmac( const QByteArray& key, const QByteArray &input )
{ {
@@ -156,6 +157,7 @@ QtScriptResolverHelper::hmac( const QByteArray& key, const QByteArray &input )
#endif #endif
} }
QString QString
QtScriptResolverHelper::md5( const QByteArray& input ) QtScriptResolverHelper::md5( const QByteArray& input )
{ {
@@ -163,6 +165,7 @@ QtScriptResolverHelper::md5( const QByteArray& input )
return QString::fromLatin1( digest.toHex() ); return QString::fromLatin1( digest.toHex() );
} }
void void
QtScriptResolverHelper::addCustomUrlHandler( const QString& protocol, const QString& callbackFuncName ) QtScriptResolverHelper::addCustomUrlHandler( const QString& protocol, const QString& callbackFuncName )
{ {
@@ -172,6 +175,7 @@ QtScriptResolverHelper::addCustomUrlHandler( const QString& protocol, const QStr
m_urlCallback = callbackFuncName; m_urlCallback = callbackFuncName;
} }
QSharedPointer< QIODevice > QSharedPointer< QIODevice >
QtScriptResolverHelper::customIODeviceFactory( const Tomahawk::result_ptr& result ) QtScriptResolverHelper::customIODeviceFactory( const Tomahawk::result_ptr& result )
{ {
@@ -253,6 +257,7 @@ QtScriptResolver::running() const
return m_ready && !m_stopped; return m_ready && !m_stopped;
} }
void void
QtScriptResolver::reload() QtScriptResolver::reload()
{ {
@@ -362,7 +367,6 @@ QtScriptResolver::resolve( const Tomahawk::query_ptr& query )
} }
QVariantMap m = m_engine->mainFrame()->evaluateJavaScript( eval ).toMap(); QVariantMap m = m_engine->mainFrame()->evaluateJavaScript( eval ).toMap();
if ( m.isEmpty() ) if ( m.isEmpty() )
{ {
// if the resolver doesn't return anything, async api is used // if the resolver doesn't return anything, async api is used
@@ -423,6 +427,7 @@ QtScriptResolver::parseResultVariantList( const QVariantList& reslist )
Q_ASSERT( !rp->mimetype().isEmpty() ); Q_ASSERT( !rp->mimetype().isEmpty() );
} }
rp->setResolvedBy( this );
results << rp; results << rp;
} }

View File

@@ -288,6 +288,7 @@ ScriptResolver::handleMsg( const QByteArray& msg )
Q_ASSERT( !rp->mimetype().isEmpty() ); Q_ASSERT( !rp->mimetype().isEmpty() );
} }
rp->setResolvedBy( this );
results << rp; results << rp;
} }