Skip to content
Snippets Groups Projects
Commit 8d4c642e authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

lrc: merge setAccountEnabled() and enableAccount() functions into one

Change-Id: I4b76a87f1c4e40c5b8ce80d38d8b0551dbde2fc7
parent aa824e3e
Branches
No related tags found
No related merge requests found
...@@ -128,12 +128,6 @@ public: ...@@ -128,12 +128,6 @@ public:
bool changeAccountPassword(const std::string& accountId, bool changeAccountPassword(const std::string& accountId,
const std::string& currentPassword, const std::string& currentPassword,
const std::string& newPassword) const; const std::string& newPassword) const;
/**
* Enable or disable an account
* @param accountId
* @param enable
*/
void enableAccount(const std::string& accountId, bool enabled);
/** /**
* Change the avatar of an account * Change the avatar of an account
* @param accountId * @param accountId
......
...@@ -178,7 +178,12 @@ NewAccountModel::getAccountList() const ...@@ -178,7 +178,12 @@ NewAccountModel::getAccountList() const
void void
NewAccountModel::setAccountEnabled(const std::string& accountId, bool enabled) const NewAccountModel::setAccountEnabled(const std::string& accountId, bool enabled) const
{ {
ConfigurationManager::instance().sendRegister(QString::fromStdString(accountId), enabled); auto accountInfo = pimpl_->accounts.find(accountId);
if (accountInfo == pimpl_->accounts.end()) {
throw std::out_of_range("NewAccountModel::getAccountConfig, can't find " + accountId);
}
accountInfo->second.enabled = enabled;
ConfigurationManager::instance().sendRegister(QString::fromStdString(accountId), enabled);
} }
void void
...@@ -226,16 +231,6 @@ NewAccountModel::getAccountConfig(const std::string& accountId) const ...@@ -226,16 +231,6 @@ NewAccountModel::getAccountConfig(const std::string& accountId) const
return accountInfo->second.confProperties; return accountInfo->second.confProperties;
} }
void
NewAccountModel::enableAccount(const std::string& accountId, bool enabled)
{
auto accountInfo = pimpl_->accounts.find(accountId);
if (accountInfo == pimpl_->accounts.end()) {
throw std::out_of_range("NewAccountModel::getAccountConfig, can't find " + accountId);
}
accountInfo->second.enabled = enabled;
}
void void
NewAccountModel::setAlias(const std::string& accountId, const std::string& alias) NewAccountModel::setAlias(const std::string& accountId, const std::string& alias)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment