mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Fix crash when accounts were loaded before attica was fetched
This commit is contained in:
@@ -83,6 +83,13 @@ LastFmAccount::~LastFmAccount()
|
|||||||
void
|
void
|
||||||
LastFmAccount::authenticate()
|
LastFmAccount::authenticate()
|
||||||
{
|
{
|
||||||
|
if ( !AtticaManager::instance()->resolversLoaded() )
|
||||||
|
{
|
||||||
|
// 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( atticaLoaded( Attica::Content::List ) ), Qt::UniqueConnection );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const Attica::Content res = AtticaManager::instance()->resolverForId( "lastfm" );
|
const Attica::Content res = AtticaManager::instance()->resolverForId( "lastfm" );
|
||||||
const AtticaManager::ResolverState state = AtticaManager::instance()->resolverState( res );
|
const AtticaManager::ResolverState state = AtticaManager::instance()->resolverState( res );
|
||||||
|
|
||||||
@@ -104,6 +111,14 @@ LastFmAccount::authenticate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LastFmAccount::atticaLoaded( Attica::Content::List )
|
||||||
|
{
|
||||||
|
disconnect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( atticaLoaded( Attica::Content::List ) ) );
|
||||||
|
authenticate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LastFmAccount::deauthenticate()
|
LastFmAccount::deauthenticate()
|
||||||
{
|
{
|
||||||
|
@@ -94,6 +94,8 @@ public:
|
|||||||
Attica::Content atticaContent() const;
|
Attica::Content atticaContent() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void atticaLoaded( Attica::Content::List );
|
||||||
|
|
||||||
void resolverInstalled( const QString& resolverId );
|
void resolverInstalled( const QString& resolverId );
|
||||||
|
|
||||||
void resolverChanged();
|
void resolverChanged();
|
||||||
|
Reference in New Issue
Block a user