1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

Copy shared pointer while passing across threads

* Fixes TWK-1571
This commit is contained in:
Uwe L. Korn
2014-05-06 22:06:24 +01:00
parent da8204fa7b
commit ad07b285ee
15 changed files with 22 additions and 22 deletions

View File

@@ -102,9 +102,9 @@ public slots:
void setShuffled( bool enabled ); void setShuffled( bool enabled );
signals: signals:
void loading( const Tomahawk::result_ptr& track ); void loading( const Tomahawk::result_ptr track );
void started( const Tomahawk::result_ptr& track ); void started( const Tomahawk::result_ptr track );
void finished( const Tomahawk::result_ptr& track ); void finished( const Tomahawk::result_ptr track );
void stopped(); void stopped();
void paused(); void paused();
void resumed(); void resumed();

View File

@@ -797,7 +797,7 @@ PlayableModel::rootItem() const
void void
PlayableModel::onPlaybackStarted( const Tomahawk::result_ptr& result ) PlayableModel::onPlaybackStarted( const Tomahawk::result_ptr result )
{ {
Q_D( PlayableModel ); Q_D( PlayableModel );
PlayableItem* oldEntry = itemFromIndex( d->currentIndex ); PlayableItem* oldEntry = itemFromIndex( d->currentIndex );

View File

@@ -188,7 +188,7 @@ private slots:
void onQueryBecamePlayable( bool playable ); void onQueryBecamePlayable( bool playable );
void onQueryResolved( bool hasResults ); void onQueryResolved( bool hasResults );
void onPlaybackStarted( const Tomahawk::result_ptr& result ); void onPlaybackStarted( const Tomahawk::result_ptr result );
void onPlaybackStopped(); void onPlaybackStopped();
private: private:

View File

@@ -62,7 +62,7 @@ QueueProxyModel::onIndexChanged( const QModelIndex& index )
void void
QueueProxyModel::onPlaybackStarted( const Tomahawk::result_ptr& result ) QueueProxyModel::onPlaybackStarted( const Tomahawk::result_ptr result )
{ {
for ( int i = 0; i < rowCount(); i++ ) for ( int i = 0; i < rowCount(); i++ )
{ {

View File

@@ -38,7 +38,7 @@ public:
private slots: private slots:
void onIndexChanged( const QModelIndex& index ); void onIndexChanged( const QModelIndex& index );
void onIndexActivated( const QModelIndex& index ); void onIndexActivated( const QModelIndex& index );
void onPlaybackStarted( const Tomahawk::result_ptr& result ); void onPlaybackStarted( const Tomahawk::result_ptr result );
}; };
#endif // QUEUEPROXYMODEL_H #endif // QUEUEPROXYMODEL_H

View File

@@ -237,7 +237,7 @@ AudioControls::onControlStateChanged()
void void
AudioControls::onPlaybackStarted( const Tomahawk::result_ptr& result ) AudioControls::onPlaybackStarted( const Tomahawk::result_ptr result )
{ {
if ( result.isNull() ) if ( result.isNull() )
return; return;
@@ -273,7 +273,7 @@ AudioControls::onPlaybackStarted( const Tomahawk::result_ptr& result )
void void
AudioControls::onPlaybackLoading( const Tomahawk::result_ptr& result ) AudioControls::onPlaybackLoading( const Tomahawk::result_ptr result )
{ {
if ( !m_currentTrack.isNull() ) if ( !m_currentTrack.isNull() )
{ {

View File

@@ -65,8 +65,8 @@ protected:
private slots: private slots:
void phononTickCheckTimeout(); void phononTickCheckTimeout();
void onPlaybackStarted( const Tomahawk::result_ptr& result ); void onPlaybackStarted( const Tomahawk::result_ptr result );
void onPlaybackLoading( const Tomahawk::result_ptr& result ); void onPlaybackLoading( const Tomahawk::result_ptr result );
void onPlaybackPaused(); void onPlaybackPaused();
void onPlaybackResumed(); void onPlaybackResumed();
void onPlaybackSeeked( qint64 msec ); void onPlaybackSeeked( qint64 msec );

View File

@@ -48,8 +48,8 @@ Scrobbler::Scrobbler( QObject* parent )
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ), SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) ); SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
connect( AudioEngine::instance(), SIGNAL( started( const Tomahawk::result_ptr& ) ), connect( AudioEngine::instance(), SIGNAL( started( const Tomahawk::result_ptr ) ),
SLOT( trackStarted( const Tomahawk::result_ptr& ) ), Qt::QueuedConnection ); SLOT( trackStarted( const Tomahawk::result_ptr ) ), Qt::QueuedConnection );
connect( AudioEngine::instance(), SIGNAL( paused() ), connect( AudioEngine::instance(), SIGNAL( paused() ),
SLOT( trackPaused() ), Qt::QueuedConnection ); SLOT( trackPaused() ), Qt::QueuedConnection );
@@ -70,7 +70,7 @@ Scrobbler::~Scrobbler()
void void
Scrobbler::trackStarted( const Tomahawk::result_ptr& track ) Scrobbler::trackStarted( const Tomahawk::result_ptr track )
{ {
Q_ASSERT( QThread::currentThread() == thread() ); Q_ASSERT( QThread::currentThread() == thread() );

View File

@@ -38,7 +38,7 @@ public:
virtual ~Scrobbler(); virtual ~Scrobbler();
public slots: public slots:
void trackStarted( const Tomahawk::result_ptr& ); void trackStarted( const Tomahawk::result_ptr );
void trackPaused(); void trackPaused();
void trackResumed(); void trackResumed();
void trackStopped(); void trackStopped();

View File

@@ -153,7 +153,7 @@ TomahawkTrayIcon::menuAboutToShow()
void void
TomahawkTrayIcon::setResult( const Tomahawk::result_ptr& result ) TomahawkTrayIcon::setResult( const Tomahawk::result_ptr result )
{ {
if ( m_currentTrack ) if ( m_currentTrack )
{ {

View File

@@ -37,7 +37,7 @@ public:
void setShowHideWindow( bool show = true ); void setShowHideWindow( bool show = true );
public slots: public slots:
void setResult( const Tomahawk::result_ptr& result ); void setResult( const Tomahawk::result_ptr result );
private slots: private slots:
void onAnimationTimer(); void onAnimationTimer();

View File

@@ -1286,7 +1286,7 @@ TomahawkWindow::audioStopped()
void void
TomahawkWindow::onPlaybackLoading( const Tomahawk::result_ptr& result ) TomahawkWindow::onPlaybackLoading( const Tomahawk::result_ptr result )
{ {
m_currentTrack = result; m_currentTrack = result;
setWindowTitle( m_windowTitle ); setWindowTitle( m_windowTitle );

View File

@@ -119,7 +119,7 @@ private slots:
void onXSPFError( XSPFLoader::XSPFErrorCode error ); void onXSPFError( XSPFLoader::XSPFErrorCode error );
void onXSPFOk( const Tomahawk::playlist_ptr& ); void onXSPFOk( const Tomahawk::playlist_ptr& );
void onPlaybackLoading( const Tomahawk::result_ptr& result ); void onPlaybackLoading( const Tomahawk::result_ptr result );
void audioStarted(); void audioStarted();
void audioFinished(); void audioFinished();

View File

@@ -66,8 +66,8 @@ XMPPBot::XMPPBot(QObject *parent)
m_client.data()->registerMessageHandler(this); m_client.data()->registerMessageHandler(this);
m_client.data()->setPresence(Presence::Available, 1, "Tomahawkbot available"); m_client.data()->setPresence(Presence::Available, 1, "Tomahawkbot available");
connect(AudioEngine::instance(), SIGNAL(started(const Tomahawk::result_ptr &)), connect(AudioEngine::instance(), SIGNAL(started(const Tomahawk::result_ptr )),
SLOT(newTrackSlot(const Tomahawk::result_ptr &))); SLOT(newTrackSlot(const Tomahawk::result_ptr )));
connect(InfoSystem::instance(), connect(InfoSystem::instance(),
SIGNAL(info(QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap)), SIGNAL(info(QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap)),

View File

@@ -66,7 +66,7 @@ public:
virtual ~XMPPBot(); virtual ~XMPPBot();
public slots: public slots:
virtual void newTrackSlot(const Tomahawk::result_ptr &track); virtual void newTrackSlot(const Tomahawk::result_ptr track);
virtual void infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData); virtual void infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData);
virtual void infoFinishedSlot(QString caller); virtual void infoFinishedSlot(QString caller);