1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-05-04 23:28:58 +02:00

Revert "Remove the http iofactory. AudioEngine handles http:// urls by giving them to phonon directly. Lets not download an mp3 twice."

This reverts commit 1c14f562ad67219e26be7a5ba6d62c0bcffaf96f.
This commit is contained in:
Leo Franchi 2011-11-04 21:20:59 -04:00
parent 2ae503612b
commit 69f1d776eb

View File

@ -80,6 +80,12 @@ Servent::Servent( QObject* parent )
boost::bind( &Servent::remoteIODeviceFactory, this, _1 );
this->registerIODeviceFactory( "servent", fac );
}
{
boost::function<QSharedPointer<QIODevice>(result_ptr)> fac =
boost::bind( &Servent::httpIODeviceFactory, this, _1 );
this->registerIODeviceFactory( "http", fac );
}
}
@ -874,3 +880,12 @@ Servent::localFileIODeviceFactory( const Tomahawk::result_ptr& result )
return QSharedPointer<QIODevice>( io );
}
QSharedPointer<QIODevice>
Servent::httpIODeviceFactory( const Tomahawk::result_ptr& result )
{
QNetworkRequest req( result->url() );
QNetworkReply* reply = TomahawkUtils::nam()->get( req );
return QSharedPointer<QIODevice>( reply, &QObject::deleteLater );
}