mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-03 12:47:45 +02:00
This should hopefully get rid of the messages about parent being in the wrong thread
This commit is contained in:
@@ -76,6 +76,7 @@ LastFmAccount::LastFmAccount( const QString& accountId )
|
|||||||
{
|
{
|
||||||
infoPlugin()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() );
|
infoPlugin()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() );
|
||||||
Tomahawk::InfoSystem::InfoSystem::instance()->addInfoPlugin( infoPlugin() );
|
Tomahawk::InfoSystem::InfoSystem::instance()->addInfoPlugin( infoPlugin() );
|
||||||
|
QMetaObject::invokeMethod( infoPlugin(), "init", Qt::QueuedConnection );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +46,17 @@ LastFmPlugin::LastFmPlugin( LastFmAccount* account )
|
|||||||
{
|
{
|
||||||
m_supportedGetTypes << InfoAlbumCoverArt << InfoArtistImages << InfoArtistSimilars << InfoArtistSongs << InfoChart << InfoChartCapabilities;
|
m_supportedGetTypes << InfoAlbumCoverArt << InfoArtistImages << InfoArtistSimilars << InfoArtistSongs << InfoChart << InfoChartCapabilities;
|
||||||
m_supportedPushTypes << InfoSubmitScrobble << InfoSubmitNowPlaying << InfoLove << InfoUnLove;
|
m_supportedPushTypes << InfoSubmitScrobble << InfoSubmitNowPlaying << InfoLove << InfoUnLove;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LastFmPlugin::init()
|
||||||
|
{
|
||||||
|
if ( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread() && thread() != Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() )
|
||||||
|
{
|
||||||
|
tDebug() << "Failure: move to the worker thread before running init";
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Flush session key cache
|
// Flush session key cache
|
||||||
// TODO WHY FLUSH
|
// TODO WHY FLUSH
|
||||||
// m_account->setSessionKey( QByteArray() );
|
// m_account->setSessionKey( QByteArray() );
|
||||||
|
@@ -49,6 +49,7 @@ public:
|
|||||||
virtual ~LastFmPlugin();
|
virtual ~LastFmPlugin();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void init();
|
||||||
void settingsChanged();
|
void settingsChanged();
|
||||||
|
|
||||||
void onAuthenticated();
|
void onAuthenticated();
|
||||||
|
@@ -192,6 +192,7 @@ TwitterAccount::connectAuthVerifyReply( const QTweetUser &user )
|
|||||||
{
|
{
|
||||||
infoPlugin()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() );
|
infoPlugin()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() );
|
||||||
Tomahawk::InfoSystem::InfoSystem::instance()->addInfoPlugin( infoPlugin() );
|
Tomahawk::InfoSystem::InfoSystem::instance()->addInfoPlugin( infoPlugin() );
|
||||||
|
QMetaObject::invokeMethod( infoPlugin(), "init", Qt::QueuedConnection );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_isAuthenticated = true;
|
m_isAuthenticated = true;
|
||||||
|
@@ -38,7 +38,18 @@ TwitterInfoPlugin::TwitterInfoPlugin( Tomahawk::Accounts::TwitterAccount* accoun
|
|||||||
: m_account( account )
|
: m_account( account )
|
||||||
{
|
{
|
||||||
m_supportedPushTypes << InfoLove;
|
m_supportedPushTypes << InfoLove;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TwitterInfoPlugin::init()
|
||||||
|
{
|
||||||
|
if ( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread() && thread() != Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() )
|
||||||
|
{
|
||||||
|
tDebug() << "Failure: move to the worker thread before running init";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QVariantHash credentials = m_account->credentials();
|
QVariantHash credentials = m_account->credentials();
|
||||||
if ( credentials[ "oauthtoken" ].toString().isEmpty() || credentials[ "oauthtokensecret" ].toString().isEmpty() )
|
if ( credentials[ "oauthtoken" ].toString().isEmpty() || credentials[ "oauthtokensecret" ].toString().isEmpty() )
|
||||||
{
|
{
|
||||||
|
@@ -44,6 +44,7 @@ namespace Tomahawk {
|
|||||||
virtual ~TwitterInfoPlugin();
|
virtual ~TwitterInfoPlugin();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void init();
|
||||||
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
|
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
|
||||||
{
|
{
|
||||||
Q_UNUSED( criteria );
|
Q_UNUSED( criteria );
|
||||||
|
Reference in New Issue
Block a user