1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 21:57:41 +02:00

Fix slow network causing multiple spotify accounts to show up

This commit is contained in:
Leo Franchi
2012-05-20 17:11:53 -04:00
parent b308212214
commit e91d9e55f6
2 changed files with 14 additions and 5 deletions

View File

@@ -97,16 +97,24 @@ SpotifyAccount::init()
setAccountFriendlyName( "Spotify" ); setAccountFriendlyName( "Spotify" );
setAccountServiceName( "spotify" ); setAccountServiceName( "spotify" );
AtticaManager::instance()->registerCustomAccount( s_resolverId, this );
qRegisterMetaType< Tomahawk::Accounts::SpotifyPlaylistInfo* >( "Tomahawk::Accounts::SpotifyPlaylist*" );
if ( !AtticaManager::instance()->resolversLoaded() ) if ( !AtticaManager::instance()->resolversLoaded() )
{ {
// If we're still waiting to load, wait for the attica resolvers to come down the pipe // If we're still waiting to load, wait for the attica resolvers to come down the pipe
connect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( init() ), Qt::UniqueConnection ); connect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( delayedInit() ), Qt::UniqueConnection );
return;
} }
else
{
delayedInit();
}
}
qRegisterMetaType< Tomahawk::Accounts::SpotifyPlaylistInfo* >( "Tomahawk::Accounts::SpotifyPlaylist*" );
AtticaManager::instance()->registerCustomAccount( s_resolverId, this ); void
SpotifyAccount::delayedInit()
{
connect( AtticaManager::instance(), SIGNAL( resolverInstalled( QString ) ), this, SLOT( resolverInstalled( QString ) ) ); connect( AtticaManager::instance(), SIGNAL( resolverInstalled( QString ) ), this, SLOT( resolverInstalled( QString ) ) );

View File

@@ -118,10 +118,11 @@ private slots:
void startPlaylistSyncWithPlaylist( const QString& msgType, const QVariantMap& msg ); void startPlaylistSyncWithPlaylist( const QString& msgType, const QVariantMap& msg );
void playlistCreated( const QString& msgType, const QVariantMap& msg ); void playlistCreated( const QString& msgType, const QVariantMap& msg );
void init(); void delayedInit();
void hookupAfterDeletion( bool autoEnable ); void hookupAfterDeletion( bool autoEnable );
private: private:
void init();
bool checkForResolver(); bool checkForResolver();
void hookupResolver(); void hookupResolver();