diff --git a/src/libtomahawk/source.cpp b/src/libtomahawk/source.cpp index 9d96792db..ebf795a08 100644 --- a/src/libtomahawk/source.cpp +++ b/src/libtomahawk/source.cpp @@ -350,6 +350,12 @@ Source::trackTimerFired() void Source::addCommand( const QSharedPointer<DatabaseCommand>& command ) { + if ( QThread::currentThread() != thread() ) + { + QMetaObject::invokeMethod( this, "addCommand", Qt::QueuedConnection, Q_ARG( const QSharedPointer<DatabaseCommand>, command ) ); + return; + } + m_cmds << command; if ( !command->singletonCmd() ) m_lastCmdGuid = command->guid(); @@ -363,7 +369,6 @@ Source::executeCommands() { if ( QThread::currentThread() != thread() ) { - tDebug() << "Reinvoking in correct thread:" << Q_FUNC_INFO; QMetaObject::invokeMethod( this, "executeCommands", Qt::QueuedConnection ); return; } diff --git a/src/libtomahawk/source.h b/src/libtomahawk/source.h index f3361a720..396094c0e 100644 --- a/src/libtomahawk/source.h +++ b/src/libtomahawk/source.h @@ -129,9 +129,9 @@ private slots: void trackTimerFired(); void executeCommands(); + void addCommand( const QSharedPointer<DatabaseCommand>& command ); private: - void addCommand( const QSharedPointer<DatabaseCommand>& command ); void updateTracks(); void reportSocialAttributesChanged( DatabaseCommand_SocialAction* action );