mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-23 09:19:41 +01:00
This should hopefully get rid of the messages about parent being in the wrong thread
This commit is contained in:
parent
4c5855c95d
commit
25fba84b32
@ -76,6 +76,7 @@ LastFmAccount::LastFmAccount( const QString& accountId )
|
||||
{
|
||||
infoPlugin()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() );
|
||||
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_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
|
||||
// TODO WHY FLUSH
|
||||
// m_account->setSessionKey( QByteArray() );
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
virtual ~LastFmPlugin();
|
||||
|
||||
public slots:
|
||||
void init();
|
||||
void settingsChanged();
|
||||
|
||||
void onAuthenticated();
|
||||
|
@ -192,6 +192,7 @@ TwitterAccount::connectAuthVerifyReply( const QTweetUser &user )
|
||||
{
|
||||
infoPlugin()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() );
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->addInfoPlugin( infoPlugin() );
|
||||
QMetaObject::invokeMethod( infoPlugin(), "init", Qt::QueuedConnection );
|
||||
}
|
||||
|
||||
m_isAuthenticated = true;
|
||||
|
@ -38,7 +38,18 @@ TwitterInfoPlugin::TwitterInfoPlugin( Tomahawk::Accounts::TwitterAccount* accoun
|
||||
: m_account( account )
|
||||
{
|
||||
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();
|
||||
if ( credentials[ "oauthtoken" ].toString().isEmpty() || credentials[ "oauthtokensecret" ].toString().isEmpty() )
|
||||
{
|
||||
|
@ -44,6 +44,7 @@ namespace Tomahawk {
|
||||
virtual ~TwitterInfoPlugin();
|
||||
|
||||
public slots:
|
||||
void init();
|
||||
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
|
||||
{
|
||||
Q_UNUSED( criteria );
|
||||
|
Loading…
x
Reference in New Issue
Block a user