diff --git a/src/libtomahawk/resolvers/ExternalResolver.h b/src/libtomahawk/resolvers/ExternalResolver.h index 29651fbee..5ff500c03 100644 --- a/src/libtomahawk/resolvers/ExternalResolver.h +++ b/src/libtomahawk/resolvers/ExternalResolver.h @@ -100,7 +100,7 @@ public: virtual QMap< QString, Tomahawk::collection_ptr > collections() { return m_collections; } // UrlLookup, sync call - virtual bool canParseUrl( const QString& url ) = 0; + virtual bool canParseUrl( const QString& url, UrlType type ) = 0; virtual void enqueue( const QSharedPointer< ScriptCommand >& req ) { m_commandQueue->enqueue( req ); } diff --git a/src/libtomahawk/resolvers/JSResolver.cpp b/src/libtomahawk/resolvers/JSResolver.cpp index 4f13d39e0..ed25ec529 100644 --- a/src/libtomahawk/resolvers/JSResolver.cpp +++ b/src/libtomahawk/resolvers/JSResolver.cpp @@ -424,7 +424,7 @@ JSResolver::tracks( const Tomahawk::collection_ptr& collection, const Tomahawk:: tDebug() << errorMessage << m; } -bool JSResolver::canParseUrl( const QString& url ) +bool JSResolver::canParseUrl( const QString& url, UrlType type ) { Q_D( JSResolver ); @@ -438,8 +438,9 @@ bool JSResolver::canParseUrl( const QString& url ) if ( d->capabilities.testFlag( UrlLookup ) ) { - QString eval = QString( "resolver.canParseUrl( '%1' );" ) - .arg( QString( url ).replace( "'", "\\'" ) ); + QString eval = QString( "resolver.canParseUrl( '%1', %2 );" ) + .arg( QString( url ).replace( "'", "\\'" ) ) + .arg( (int) type ); return d->engine->mainFrame()->evaluateJavaScript( eval ).toBool(); } else diff --git a/src/libtomahawk/resolvers/JSResolver.h b/src/libtomahawk/resolvers/JSResolver.h index fc270ac99..74de68b5d 100644 --- a/src/libtomahawk/resolvers/JSResolver.h +++ b/src/libtomahawk/resolvers/JSResolver.h @@ -58,7 +58,7 @@ public: virtual void setIcon( const QPixmap& icon ); - virtual bool canParseUrl( const QString& url ); + virtual bool canParseUrl( const QString& url, UrlType type ); public slots: virtual void resolve( const Tomahawk::query_ptr& query ); diff --git a/src/libtomahawk/resolvers/ScriptResolver.h b/src/libtomahawk/resolvers/ScriptResolver.h index 002532612..d568d5a34 100644 --- a/src/libtomahawk/resolvers/ScriptResolver.h +++ b/src/libtomahawk/resolvers/ScriptResolver.h @@ -64,7 +64,7 @@ public: void sendMessage( const QVariantMap& map ); - virtual bool canParseUrl( const QString& ) { return false; } + virtual bool canParseUrl( const QString&, UrlType ) { return false; } signals: void terminated(); diff --git a/src/tomahawk/TomahawkApp.cpp b/src/tomahawk/TomahawkApp.cpp index 88a7e3ea3..43e4198b1 100644 --- a/src/tomahawk/TomahawkApp.cpp +++ b/src/tomahawk/TomahawkApp.cpp @@ -839,7 +839,7 @@ TomahawkApp::loadUrl( const QString& url ) QList< QPointer< ExternalResolver > > possibleResolvers; foreach ( QPointer resolver, Pipeline::instance()->scriptResolvers() ) { - if ( resolver->canParseUrl( url ) ) + if ( resolver->canParseUrl( url, ExternalResolver::Any ) ) { canParse = true; possibleResolvers << resolver;