Commit 3308dee9 authored by Alexander Potashev's avatar Alexander Potashev Committed by Nate Graham

Fix bug: Some user profile fields won't apply unless they all have unique new values.

Fixes the following bug: Some user profile fields won't apply unless
they all have unique new values.

STEPS TO REPRODUCE
1. Start the Users KCM ("kcmshell5 kcm_users")
2. Select a user
3. Change the full name (the top-most input field) to "foo", change the
   email address to "foo@example.com", click Apply.
4. Restart the Users KCM and make sure the change applied.
5. Change the full name to "bar@example.com", change the email address
   to "bar@example.com" as well, click Apply.

OBSERVED RESULT: The full name remains "foo", the email address is
changed to "bar@example.com".

EXPECTED RESULT: Both fields should change to "bar@example.com".

Root cause: When the std::map used in UserApplyJob::start() is
initialized, the key-value {"bar@example.com", full name setter ptr} is
being overwritten by key-value {"bar@example.com", email setter ptr}.

BUG: 427348


(cherry picked from commit 5cdff962)
parent 7079d095
......@@ -258,7 +258,7 @@ UserApplyJob::UserApplyJob(QPointer<OrgFreedesktopAccountsUserInterface> dbusIfa
void UserApplyJob::start()
{
const std::map<QString,QDBusPendingReply<> (OrgFreedesktopAccountsUserInterface::*)(const QString&)> set = {
const std::multimap<QString,QDBusPendingReply<> (OrgFreedesktopAccountsUserInterface::*)(const QString&)> set = {
{m_name, &OrgFreedesktopAccountsUserInterface::SetUserName},
{m_email, &OrgFreedesktopAccountsUserInterface::SetEmail},
{m_realname, &OrgFreedesktopAccountsUserInterface::SetRealName},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment