Skip to content
Snippets Groups Projects
Commit aa824e3e authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Adrien Béraud
Browse files

lrc: add setAccountEnabled() function to properly change account enable state

- the function will call sendRegister that will also saveConfig
  we can just change the enable option in account so that
  reduce the complexity of calling setAccountConfig

Change-Id: Id37093fb174dd45dadf2886063da6779ea7bcc47
parent ca2a0dd8
Branches
No related tags found
No related merge requests found
...@@ -76,6 +76,14 @@ public: ...@@ -76,6 +76,14 @@ public:
* flag account corresponding to passed id as freeable. * flag account corresponding to passed id as freeable.
*/ */
void flagFreeable(const std::string& accountId) const; void flagFreeable(const std::string& accountId) const;
/**
* set account enable/disable, save config and do unregister for account
* @param accountId.
* @param enabled.
*/
void setAccountEnabled(const std::string& accountID, bool enabled) const;
/** /**
* saves account config to .yml * saves account config to .yml
* @param accountId. * @param accountId.
......
...@@ -175,6 +175,12 @@ NewAccountModel::getAccountList() const ...@@ -175,6 +175,12 @@ NewAccountModel::getAccountList() const
return accountsId; return accountsId;
} }
void
NewAccountModel::setAccountEnabled(const std::string& accountId, bool enabled) const
{
ConfigurationManager::instance().sendRegister(QString::fromStdString(accountId), enabled);
}
void void
NewAccountModel::setAccountConfig(const std::string& accountId, NewAccountModel::setAccountConfig(const std::string& accountId,
const account::ConfProperties_t& confProperties) const const account::ConfProperties_t& confProperties) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment