1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

Pass less references around threads

This commit is contained in:
Uwe L. Korn
2014-07-01 21:07:41 +01:00
parent 52701463cc
commit ff89f015cd
8 changed files with 11 additions and 11 deletions

View File

@@ -242,14 +242,14 @@ Api_v1::sid( QxtWebRequestEvent* event, QString unused )
return send404( event ); return send404( event );
} }
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback = boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback =
boost::bind( &Api_v1::processSid, this, event, rp, _1, _2 ); boost::bind( &Api_v1::processSid, this, event, rp, _1, _2 );
Tomahawk::UrlHandler::getIODeviceForUrl( rp, rp->url(), callback ); Tomahawk::UrlHandler::getIODeviceForUrl( rp, rp->url(), callback );
} }
void void
Api_v1::processSid( QxtWebRequestEvent* event, Tomahawk::result_ptr& rp, const QString& url, QSharedPointer< QIODevice >& iodev ) Api_v1::processSid( QxtWebRequestEvent* event, const Tomahawk::result_ptr rp, const QString url, QSharedPointer< QIODevice > iodev )
{ {
Q_UNUSED( url ); Q_UNUSED( url );

View File

@@ -89,7 +89,7 @@ protected:
void sendPlain404( QxtWebRequestEvent* event, const QString& message, const QString& statusmessage ); void sendPlain404( QxtWebRequestEvent* event, const QString& message, const QString& statusmessage );
private: private:
void processSid( QxtWebRequestEvent* event, Tomahawk::result_ptr&, const QString& url, QSharedPointer< QIODevice >& ); void processSid( QxtWebRequestEvent* event, const Tomahawk::result_ptr, const QString url, QSharedPointer< QIODevice > );
QSharedPointer< QIODevice > m_ioDevice; QSharedPointer< QIODevice > m_ioDevice;
Api_v1_5* m_api_v1_5; Api_v1_5* m_api_v1_5;

View File

@@ -68,7 +68,7 @@ registerIODeviceFactory( const QString &proto, IODeviceFactoryFunc fac )
void void
getIODeviceForUrl( const Tomahawk::result_ptr& result, const QString& url, getIODeviceForUrl( const Tomahawk::result_ptr& result, const QString& url,
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback ) boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback )
{ {
if ( iofactories.isEmpty() ) if ( iofactories.isEmpty() )
{ {

View File

@@ -41,7 +41,7 @@ namespace UrlHandler
{ {
DLLEXPORT void getIODeviceForUrl( const Tomahawk::result_ptr&, const QString& url, DLLEXPORT void getIODeviceForUrl( const Tomahawk::result_ptr&, const QString& url,
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback ); boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback );
DLLEXPORT void registerIODeviceFactory( const QString& proto, IODeviceFactoryFunc fac ); DLLEXPORT void registerIODeviceFactory( const QString& proto, IODeviceFactoryFunc fac );
DLLEXPORT void localFileIODeviceFactory( const Tomahawk::result_ptr& result, const QString& url, DLLEXPORT void localFileIODeviceFactory( const Tomahawk::result_ptr& result, const QString& url,
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback ); boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback );

View File

@@ -686,7 +686,7 @@ AudioEngine::performLoadIODevice( const result_ptr& result, const QString& url )
if ( !TomahawkUtils::isLocalResult( url ) && !TomahawkUtils::isHttpResult( url ) if ( !TomahawkUtils::isLocalResult( url ) && !TomahawkUtils::isHttpResult( url )
&& !TomahawkUtils::isRtmpResult( url ) ) && !TomahawkUtils::isRtmpResult( url ) )
{ {
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback = boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback =
boost::bind( &AudioEngine::performLoadTrack, this, result, _1, _2 ); boost::bind( &AudioEngine::performLoadTrack, this, result, _1, _2 );
Tomahawk::UrlHandler::getIODeviceForUrl( result, url, callback ); Tomahawk::UrlHandler::getIODeviceForUrl( result, url, callback );
} }
@@ -699,7 +699,7 @@ AudioEngine::performLoadIODevice( const result_ptr& result, const QString& url )
void void
AudioEngine::performLoadTrack( const Tomahawk::result_ptr& result, const QString& url, QSharedPointer< QIODevice >& io ) AudioEngine::performLoadTrack( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io )
{ {
Q_D( AudioEngine ); Q_D( AudioEngine );
if ( currentTrack() != result ) if ( currentTrack() != result )

View File

@@ -178,7 +178,7 @@ signals:
private slots: private slots:
void loadTrack( const Tomahawk::result_ptr& result ); //async! void loadTrack( const Tomahawk::result_ptr& result ); //async!
void performLoadIODevice( const Tomahawk::result_ptr& result, const QString& url ); //only call from loadTrack kthxbi void performLoadIODevice( const Tomahawk::result_ptr& result, const QString& url ); //only call from loadTrack kthxbi
void performLoadTrack( const Tomahawk::result_ptr& result, const QString& url, QSharedPointer< QIODevice >& io ); //only call from loadTrack or performLoadIODevice kthxbi void performLoadTrack( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io ); //only call from loadTrack or performLoadIODevice kthxbi
void loadPreviousTrack(); void loadPreviousTrack();
void loadNextTrack(); void loadNextTrack();

View File

@@ -188,14 +188,14 @@ StreamConnection::startSending( const Tomahawk::result_ptr& result )
m_result = result; m_result = result;
qDebug() << "Starting to transmit" << m_result->url(); qDebug() << "Starting to transmit" << m_result->url();
boost::function< void ( const QString&, QSharedPointer< QIODevice >& ) > callback = boost::function< void ( const QString, QSharedPointer< QIODevice > ) > callback =
boost::bind( &StreamConnection::reallyStartSending, this, result, _1, _2 ); boost::bind( &StreamConnection::reallyStartSending, this, result, _1, _2 );
Tomahawk::UrlHandler::getIODeviceForUrl( m_result, m_result->url(), callback ); Tomahawk::UrlHandler::getIODeviceForUrl( m_result, m_result->url(), callback );
} }
void void
StreamConnection::reallyStartSending( const Tomahawk::result_ptr& result, const QString& url, QSharedPointer< QIODevice >& io ) StreamConnection::reallyStartSending( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io )
{ {
Q_UNUSED( url ); Q_UNUSED( url );

View File

@@ -73,7 +73,7 @@ protected slots:
private slots: private slots:
void startSending( const Tomahawk::result_ptr& result ); void startSending( const Tomahawk::result_ptr& result );
void reallyStartSending( const Tomahawk::result_ptr& result, const QString& url, QSharedPointer< QIODevice >& io ); //only called back from startSending void reallyStartSending( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io ); //only called back from startSending
void sendSome(); void sendSome();
void showStats( qint64 tx, qint64 rx ); void showStats( qint64 tx, qint64 rx );