Skip to content
Snippets Groups Projects
Commit 2ce607fe authored by Adrien Béraud's avatar Adrien Béraud
Browse files

account: use emplace, to_string where possible

Refs #67228

Change-Id: I96f2e1627b228774e4ea1aa262bac26021ac7bab
parent 54d367e5
Branches
Tags
No related merge requests found
...@@ -271,37 +271,28 @@ Account::setAccountDetails(const std::map<std::string, std::string> &details) ...@@ -271,37 +271,28 @@ Account::setAccountDetails(const std::map<std::string, std::string> &details)
std::map<std::string, std::string> std::map<std::string, std::string>
Account::getAccountDetails() const Account::getAccountDetails() const
{ {
std::map<std::string, std::string> a; return {
{Conf::CONFIG_ACCOUNT_ALIAS, alias_},
a[Conf::CONFIG_ACCOUNT_ALIAS] = alias_; {Conf::CONFIG_ACCOUNT_ENABLE, enabled_ ? TRUE_STR : FALSE_STR},
a[Conf::CONFIG_ACCOUNT_ENABLE] = enabled_ ? "true" : "false"; {Conf::CONFIG_ACCOUNT_TYPE, getAccountType()},
a[Conf::CONFIG_ACCOUNT_TYPE] = getAccountType(); {Conf::CONFIG_ACCOUNT_HOSTNAME, hostname_},
a[Conf::CONFIG_ACCOUNT_HOSTNAME] = hostname_; {Conf::CONFIG_ACCOUNT_USERNAME, username_},
a[Conf::CONFIG_ACCOUNT_USERNAME] = username_; {Conf::CONFIG_ACCOUNT_MAILBOX, mailBox_},
a[Conf::CONFIG_ACCOUNT_MAILBOX] = mailBox_; {Conf::CONFIG_ACCOUNT_USERAGENT, hasCustomUserAgent_ ? userAgent_ : DEFAULT_USER_AGENT},
{Conf::CONFIG_ACCOUNT_HAS_CUSTOM_USERAGENT, hasCustomUserAgent_ ? userAgent_ : DEFAULT_USER_AGENT},
RegistrationState state(registrationState_); {Conf::CONFIG_ACCOUNT_AUTOANSWER, autoAnswerEnabled_ ? TRUE_STR : FALSE_STR},
{Conf::CONFIG_RINGTONE_ENABLED, ringtoneEnabled_ ? TRUE_STR : FALSE_STR},
// This method should only stores user-settable fields {Conf::CONFIG_RINGTONE_PATH, ringtonePath_},
// For legacy reasons, the STATUS will be kept for some time {Conf::CONFIG_UPNP_ENABLED, upnpEnabled_ ? TRUE_STR : FALSE_STR},
a[Conf::CONFIG_ACCOUNT_REGISTRATION_STATUS] = mapStateNumberToString(state); };
a[Conf::CONFIG_ACCOUNT_USERAGENT] = hasCustomUserAgent_ ? userAgent_ : DEFAULT_USER_AGENT;
a[Conf::CONFIG_ACCOUNT_HAS_CUSTOM_USERAGENT] = hasCustomUserAgent_ ? TRUE_STR : FALSE_STR;
a[Conf::CONFIG_ACCOUNT_AUTOANSWER] = autoAnswerEnabled_ ? TRUE_STR : FALSE_STR;
a[Conf::CONFIG_RINGTONE_ENABLED] = ringtoneEnabled_ ? TRUE_STR : FALSE_STR;
a[Conf::CONFIG_RINGTONE_PATH] = ringtonePath_;
a[Conf::CONFIG_UPNP_ENABLED] = upnpEnabled_ ? TRUE_STR : FALSE_STR;
return a;
} }
std::map<std::string, std::string> std::map<std::string, std::string>
Account::getVolatileAccountDetails() const Account::getVolatileAccountDetails() const
{ {
std::map<std::string, std::string> a; return {
{Conf::CONFIG_ACCOUNT_REGISTRATION_STATUS, mapStateNumberToString(registrationState_)}
a[Conf::CONFIG_ACCOUNT_REGISTRATION_STATUS] = mapStateNumberToString(registrationState_); };
return a;
} }
// Convert a list of payloads in a special format, readable by the server. // Convert a list of payloads in a special format, readable by the server.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment