mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 19:37:09 +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;
|
||||
|
||||
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
|
||||
AccountManager::hookupAccount( Account* account ) const
|
||||
{
|
||||
|
@@ -96,6 +96,7 @@ public:
|
||||
|
||||
CredentialsManager* credentialsManager() const { return m_creds; }
|
||||
ConfigStorage* configStorageForAccount( const QString& accountId );
|
||||
ConfigStorage* localConfigStorage();
|
||||
|
||||
public slots:
|
||||
void connectAll();
|
||||
|
@@ -22,6 +22,9 @@
|
||||
#include "jobview/JobStatusView.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
#include "jobview/ErrorStatusMessage.h"
|
||||
#include "AccountManager.h"
|
||||
#include "AtticaManager.h"
|
||||
#include "ConfigStorage.h"
|
||||
#include "resolvers/ExternalResolver.h"
|
||||
#include "resolvers/ExternalResolverGui.h"
|
||||
#include "utils/Logger.h"
|
||||
@@ -302,6 +305,10 @@ ResolverAccount::ResolverAccount( const QString& accountId, const QString& path,
|
||||
|
||||
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 );
|
||||
|
||||
sync();
|
||||
|
Reference in New Issue
Block a user