1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* Fixed Source method being run in the wrong thread.

This commit is contained in:
Christian Muehlhaeuser 2012-03-07 04:45:32 +01:00
parent 89009c09be
commit 6552deca61
2 changed files with 7 additions and 2 deletions

View File

@ -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;
}

View File

@ -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 );