mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-18 03:41:27 +02:00
Store to LocalConfigStorage as fallback when installing a ResolverAccount.
This commit is contained in:
@@ -143,7 +143,8 @@ Account::loadFromConfig( const QString& accountId )
|
|||||||
{
|
{
|
||||||
m_accountId = accountId;
|
m_accountId = accountId;
|
||||||
|
|
||||||
AccountManager::instance()->configStorageForAccount( m_accountId )->load( m_accountId, m_cfg );
|
if ( AccountManager::instance()->configStorageForAccount( m_accountId ) != 0 ) //could be 0 if we are installing the account right now
|
||||||
|
AccountManager::instance()->configStorageForAccount( m_accountId )->load( m_accountId, m_cfg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -424,6 +424,13 @@ AccountManager::configStorageForAccount( const QString& accountId )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ConfigStorage*
|
||||||
|
AccountManager::localConfigStorage()
|
||||||
|
{
|
||||||
|
return m_configStorageById.value( "localconfigstorage" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AccountManager::hookupAccount( Account* account ) const
|
AccountManager::hookupAccount( Account* account ) const
|
||||||
{
|
{
|
||||||
|
@@ -96,6 +96,7 @@ public:
|
|||||||
|
|
||||||
CredentialsManager* credentialsManager() const { return m_creds; }
|
CredentialsManager* credentialsManager() const { return m_creds; }
|
||||||
ConfigStorage* configStorageForAccount( const QString& accountId );
|
ConfigStorage* configStorageForAccount( const QString& accountId );
|
||||||
|
ConfigStorage* localConfigStorage();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void connectAll();
|
void connectAll();
|
||||||
|
@@ -22,6 +22,9 @@
|
|||||||
#include "jobview/JobStatusView.h"
|
#include "jobview/JobStatusView.h"
|
||||||
#include "jobview/JobStatusModel.h"
|
#include "jobview/JobStatusModel.h"
|
||||||
#include "jobview/ErrorStatusMessage.h"
|
#include "jobview/ErrorStatusMessage.h"
|
||||||
|
#include "AccountManager.h"
|
||||||
|
#include "AtticaManager.h"
|
||||||
|
#include "ConfigStorage.h"
|
||||||
#include "resolvers/ExternalResolver.h"
|
#include "resolvers/ExternalResolver.h"
|
||||||
#include "resolvers/ExternalResolverGui.h"
|
#include "resolvers/ExternalResolverGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
@@ -302,6 +305,10 @@ ResolverAccount::ResolverAccount( const QString& accountId, const QString& path,
|
|||||||
|
|
||||||
setConfiguration( configuration );
|
setConfiguration( configuration );
|
||||||
|
|
||||||
|
//just init so this account is tracked by LCS, we'll sync later
|
||||||
|
if ( !AccountManager::instance()->configStorageForAccount( accountId ) )
|
||||||
|
AccountManager::instance()->localConfigStorage()->save( accountId, Account::Configuration() );
|
||||||
|
|
||||||
init( path );
|
init( path );
|
||||||
|
|
||||||
sync();
|
sync();
|
||||||
|
Reference in New Issue
Block a user