mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* Fixed Source method being run in the wrong thread.
This commit is contained in:
@@ -350,6 +350,12 @@ Source::trackTimerFired()
|
|||||||
void
|
void
|
||||||
Source::addCommand( const QSharedPointer<DatabaseCommand>& command )
|
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;
|
m_cmds << command;
|
||||||
if ( !command->singletonCmd() )
|
if ( !command->singletonCmd() )
|
||||||
m_lastCmdGuid = command->guid();
|
m_lastCmdGuid = command->guid();
|
||||||
@@ -363,7 +369,6 @@ Source::executeCommands()
|
|||||||
{
|
{
|
||||||
if ( QThread::currentThread() != thread() )
|
if ( QThread::currentThread() != thread() )
|
||||||
{
|
{
|
||||||
tDebug() << "Reinvoking in correct thread:" << Q_FUNC_INFO;
|
|
||||||
QMetaObject::invokeMethod( this, "executeCommands", Qt::QueuedConnection );
|
QMetaObject::invokeMethod( this, "executeCommands", Qt::QueuedConnection );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -129,9 +129,9 @@ private slots:
|
|||||||
void trackTimerFired();
|
void trackTimerFired();
|
||||||
|
|
||||||
void executeCommands();
|
void executeCommands();
|
||||||
|
void addCommand( const QSharedPointer<DatabaseCommand>& command );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addCommand( const QSharedPointer<DatabaseCommand>& command );
|
|
||||||
void updateTracks();
|
void updateTracks();
|
||||||
void reportSocialAttributesChanged( DatabaseCommand_SocialAction* action );
|
void reportSocialAttributesChanged( DatabaseCommand_SocialAction* action );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user