1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 11:50:37 +02:00

Don't wait for timeouts on resolver errors

This commit is contained in:
Dominik Schmidt
2015-11-13 14:12:12 +01:00
parent 35d8945975
commit 846699c03c
3 changed files with 13 additions and 2 deletions

View File

@@ -323,6 +323,13 @@ Pipeline::resolve( QID qid, bool prioritized, bool temporaryQuery )
}
void
Pipeline::reportError( QID qid, Tomahawk::Resolver* r )
{
reportResults( qid, r, QList< result_ptr>() );
}
void
Pipeline::reportResults( QID qid, Tomahawk::Resolver* r, const QList< result_ptr >& results )
{

View File

@@ -54,6 +54,7 @@ public:
unsigned int pendingQueryCount() const;
unsigned int activeQueryCount() const;
void reportError( QID qid, Tomahawk::Resolver* r );
void reportResults( QID qid, Tomahawk::Resolver* r, const QList< result_ptr >& results );
void reportAlbums( QID qid, const QList< album_ptr >& albums );
void reportArtists( QID qid, const QList< artist_ptr >& artists );

View File

@@ -566,9 +566,12 @@ JSResolver::onResolveRequestDone( const QVariantMap& data )
Q_D( JSResolver );
ScriptJob* job = qobject_cast< ScriptJob* >( sender() );
QID qid = job->property( "qid" ).toString();
if ( job->error() )
{
// what do here?!
Tomahawk::Pipeline::instance()->reportError( qid, this );
}
else
{
@@ -581,7 +584,7 @@ JSResolver::onResolveRequestDone( const QVariantMap& data )
result->setFriendlySource( name() );
}
Tomahawk::Pipeline::instance()->reportResults( job->property( "qid" ).toString(), this, results );
Tomahawk::Pipeline::instance()->reportResults( qid, this, results );
}
sender()->deleteLater();