mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-30 19:00:12 +02:00
tomahawk: pass the NetworkReply directly to stop segfaulting
* this now means the Google Music resolver works :)
This commit is contained in:
@@ -611,14 +611,12 @@ JSResolverHelper::returnStreamUrl( const QString& streamUrl, const QMap<QString,
|
||||
tDebug() << "Creating a QNetowrkReply with url:" << req.url().toString();
|
||||
NetworkReply* reply = new NetworkReply( Tomahawk::Utils::nam()->get( req ) );
|
||||
|
||||
NewClosure( QSharedPointer<NetworkReply>( reply ) , SIGNAL( finalUrlReached() ), this, SLOT( gotStreamUrl( boost::function< void( QSharedPointer< QIODevice >& ) > ) ), callback );
|
||||
NewClosure( QSharedPointer<NetworkReply>( 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();
|
||||
|
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "DllMacro.h"
|
||||
#include "Typedefs.h"
|
||||
#include "utils/NetworkReply.h"
|
||||
|
||||
#include <boost/function.hpp>
|
||||
|
||||
@@ -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<Tomahawk::query_ptr>& tracks, const Tomahawk::ModelMode, const Tomahawk::collection_ptr& collection );
|
||||
void pltemplateTracksLoadedForUrl( const QString& url, const Tomahawk::playlisttemplate_ptr& pltemplate );
|
||||
|
||||
|
Reference in New Issue
Block a user