mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-26 23:35:32 +02:00
Fix race condition on loading resolver icons & loading attica resolvers
This commit is contained in:
@@ -240,11 +240,9 @@ AtticaResolverAccount::AtticaResolverAccount( const QString& accountId )
|
|||||||
{
|
{
|
||||||
TomahawkSettings::instance()->setValue( QString( "accounts/%1/atticaresolver" ).arg( accountId ), true );
|
TomahawkSettings::instance()->setValue( QString( "accounts/%1/atticaresolver" ).arg( accountId ), true );
|
||||||
|
|
||||||
|
init();
|
||||||
m_atticaId = configuration().value( "atticaId" ).toString();
|
m_atticaId = configuration().value( "atticaId" ).toString();
|
||||||
|
|
||||||
connect( AtticaManager::instance(), SIGNAL( resolverIconUpdated( QString ) ), this, SLOT( resolverIconUpdated( QString ) ) );
|
|
||||||
|
|
||||||
loadIcon();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AtticaResolverAccount::AtticaResolverAccount( const QString& accountId, const QString& path, const QString& atticaId )
|
AtticaResolverAccount::AtticaResolverAccount( const QString& accountId, const QString& path, const QString& atticaId )
|
||||||
@@ -257,9 +255,7 @@ AtticaResolverAccount::AtticaResolverAccount( const QString& accountId, const QS
|
|||||||
|
|
||||||
TomahawkSettings::instance()->setValue( QString( "accounts/%1/atticaresolver" ).arg( accountId ), true );
|
TomahawkSettings::instance()->setValue( QString( "accounts/%1/atticaresolver" ).arg( accountId ), true );
|
||||||
|
|
||||||
connect( AtticaManager::instance(), SIGNAL( resolverIconUpdated( QString ) ), this, SLOT( resolverIconUpdated( QString ) ) );
|
init();
|
||||||
|
|
||||||
loadIcon();
|
|
||||||
sync();
|
sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,6 +265,20 @@ AtticaResolverAccount::~AtticaResolverAccount()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
AtticaResolverAccount::init()
|
||||||
|
{
|
||||||
|
connect( AtticaManager::instance(), SIGNAL( resolverIconUpdated( QString ) ), this, SLOT( resolverIconUpdated( QString ) ) );
|
||||||
|
|
||||||
|
if ( AtticaManager::instance()->resolversLoaded() )
|
||||||
|
loadIcon();
|
||||||
|
else
|
||||||
|
connect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( loadIcon() ) );
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AtticaResolverAccount::loadIcon()
|
AtticaResolverAccount::loadIcon()
|
||||||
{
|
{
|
||||||
|
@@ -122,11 +122,12 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void resolverIconUpdated( const QString& );
|
void resolverIconUpdated( const QString& );
|
||||||
|
|
||||||
|
void loadIcon();
|
||||||
private:
|
private:
|
||||||
// Created by factory, when user installs a new resolver
|
// Created by factory, when user installs a new resolver
|
||||||
AtticaResolverAccount( const QString& accountId, const QString& path, const QString& atticaId );
|
AtticaResolverAccount( const QString& accountId, const QString& path, const QString& atticaId );
|
||||||
|
|
||||||
void loadIcon();
|
void init();
|
||||||
|
|
||||||
QPixmap m_icon;
|
QPixmap m_icon;
|
||||||
QString m_atticaId;
|
QString m_atticaId;
|
||||||
|
Reference in New Issue
Block a user