diff --git a/src/libtomahawk/resolvers/JSResolverHelper.cpp b/src/libtomahawk/resolvers/JSResolverHelper.cpp index c40f52732..fb5d2275d 100644 --- a/src/libtomahawk/resolvers/JSResolverHelper.cpp +++ b/src/libtomahawk/resolvers/JSResolverHelper.cpp @@ -611,14 +611,12 @@ JSResolverHelper::returnStreamUrl( const QString& streamUrl, const QMapget( req ) ); - NewClosure( QSharedPointer( reply ) , SIGNAL( finalUrlReached() ), this, SLOT( gotStreamUrl( boost::function< void( QSharedPointer< QIODevice >& ) > ) ), callback ); + NewClosure( QSharedPointer( reply ) , SIGNAL( finalUrlReached() ), this, SLOT( gotStreamUrl( boost::function< void( QSharedPointer< QIODevice >& ) >, NetworkReply* )), callback, reply ); } void -JSResolverHelper::gotStreamUrl( boost::function< void( QSharedPointer< QIODevice >& ) > callback ) +JSResolverHelper::gotStreamUrl( boost::function< void( QSharedPointer< QIODevice >& ) > callback, NetworkReply* reply ) { - NetworkReply* reply = (NetworkReply*) sender(); - //boost::functions cannot accept temporaries as parameters QSharedPointer< QIODevice > sp = QSharedPointer< QIODevice >( reply->reply(), &QObject::deleteLater ); reply->disconnectFromReply(); diff --git a/src/libtomahawk/resolvers/JSResolverHelper.h b/src/libtomahawk/resolvers/JSResolverHelper.h index 1a2c34d0d..be52b31f5 100644 --- a/src/libtomahawk/resolvers/JSResolverHelper.h +++ b/src/libtomahawk/resolvers/JSResolverHelper.h @@ -24,6 +24,7 @@ #include "DllMacro.h" #include "Typedefs.h" +#include "utils/NetworkReply.h" #include @@ -82,7 +83,7 @@ public slots: void reportCapabilities( const QVariant& capabilities ); private slots: - void gotStreamUrl( boost::function< void( QSharedPointer< QIODevice >& ) > callback ); + void gotStreamUrl( boost::function< void( QSharedPointer< QIODevice >& ) > callback, NetworkReply* reply ); void tracksAdded( const QList& tracks, const Tomahawk::ModelMode, const Tomahawk::collection_ptr& collection ); void pltemplateTracksLoadedForUrl( const QString& url, const Tomahawk::playlisttemplate_ptr& pltemplate );