1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01: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
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 );
}

View File

@ -131,6 +131,7 @@ QtScriptResolverHelper::setResolverConfig( const QVariantMap& config )
m_resolverConfig = config;
}
QString
QtScriptResolverHelper::hmac( const QByteArray& key, const QByteArray &input )
{
@ -156,6 +157,7 @@ QtScriptResolverHelper::hmac( const QByteArray& key, const QByteArray &input )
#endif
}
QString
QtScriptResolverHelper::md5( const QByteArray& input )
{
@ -163,6 +165,7 @@ QtScriptResolverHelper::md5( const QByteArray& input )
return QString::fromLatin1( digest.toHex() );
}
void
QtScriptResolverHelper::addCustomUrlHandler( const QString& protocol, const QString& callbackFuncName )
{
@ -172,6 +175,7 @@ QtScriptResolverHelper::addCustomUrlHandler( const QString& protocol, const QStr
m_urlCallback = callbackFuncName;
}
QSharedPointer< QIODevice >
QtScriptResolverHelper::customIODeviceFactory( const Tomahawk::result_ptr& result )
{
@ -253,6 +257,7 @@ QtScriptResolver::running() const
return m_ready && !m_stopped;
}
void
QtScriptResolver::reload()
{
@ -362,8 +367,7 @@ QtScriptResolver::resolve( const Tomahawk::query_ptr& query )
}
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
return;
@ -423,6 +427,7 @@ QtScriptResolver::parseResultVariantList( const QVariantList& reslist )
Q_ASSERT( !rp->mimetype().isEmpty() );
}
rp->setResolvedBy( this );
results << rp;
}

View File

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