Fix change current user name failed.

This commit is contained in:
sunwen
2024-05-06 17:44:21 +08:00
parent 29fea313ad
commit 6a48d60458
4 changed files with 11 additions and 1 deletions

View File

@@ -191,13 +191,14 @@ bool AccountFormDialog::updateReferenceData()
warn(tr("User Name can't be empty!"));
return false;
}
User::Current()->setUserName(mNewUserName);
}
if (!this->mCommentChanged) User::Current()->setUserName(mLeComment->text());
User::Current()->setUserName(mNewUserName);
bool ret = User::Current()->submitChange();
if (ret)
{
hideWarn();
EventCenter::Default()->triggerEvent(CurrentUserNameChanged, nullptr, nullptr);
LOG_USER_OPERATION("Change User Name")
}
else

View File

@@ -37,6 +37,7 @@ void ChangePasswordFormDialog::initLayout()
layout->addWidget(mLEPasswd);
auto lblEndline1 = new QLabel(this);
lblEndline1->setObjectName("endline");
lblEndline1->setFixedHeight(3);
layout->addWidget(lblEndline1);
//add new password
@@ -47,6 +48,7 @@ void ChangePasswordFormDialog::initLayout()
layout->addWidget(lblNewPasswd);
layout->addWidget(mLENewPasswd);
auto lblEndline2 = new QLabel(this);
lblEndline2->setFixedHeight(3);
lblEndline2->setObjectName("endline");
layout->addWidget(lblEndline2);
@@ -58,6 +60,7 @@ void ChangePasswordFormDialog::initLayout()
layout->addWidget(lblConfirm);
layout->addWidget(mLEConfirmPasswd);
auto lblEndline3 = new QLabel(this);
lblEndline3->setFixedHeight(3);
lblEndline3->setObjectName("endline");
layout->addWidget(lblEndline3);