sync: from linuxdeepin/dde-session-shell#518
Conversation
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#72
Reviewer's guide (collapsed on small PRs)Reviewer's GuideResets password field behavior to a secure default during auth widget reset and synchronizes icon state with the hidden password state. Sequence diagram for AuthPassword reset behaviorsequenceDiagram
participant User
participant AuthPassword
participant PasswordLineEdit
participant PasswordShowBtn
User->>AuthPassword: reset()
AuthPassword->>PasswordLineEdit: setAlert(false)
AuthPassword->>PasswordLineEdit: hideAlertMessage()
AuthPassword->>PasswordLineEdit: setEchoMode(QLineEdit_Password)
AuthPassword->>PasswordShowBtn: setIcon(PASSWORD_SHOWN)
AuthPassword->>AuthPassword: hidePasswordHintWidget()
AuthPassword->>AuthPassword: setLineEditEnabled(true)
AuthPassword->>AuthPassword: setLineEditInfo(Password, PlaceHolderText)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
AuthPassword::reset(), double-check that usingQLineEdit::Passwordand thePASSWORD_SHOWNicon together reflects the intended initial state (password hidden vs shown), as the naming suggests a possible mismatch. - If there are multiple code paths that initialize or reset the password field’s echo mode and toggle icon, consider centralizing this logic to a single helper to keep the UI state consistent across different flows.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `AuthPassword::reset()`, double-check that using `QLineEdit::Password` and the `PASSWORD_SHOWN` icon together reflects the intended initial state (password hidden vs shown), as the naming suggests a possible mismatch.
- If there are multiple code paths that initialize or reset the password field’s echo mode and toggle icon, consider centralizing this logic to a single helper to keep the UI state consistent across different flows.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 diff --git a/src/session-widgets/auth_password.cpp b/src/session-widgets/auth_password.cpp
index 1d6fbe1b..000fec54 100644
--- a/src/session-widgets/auth_password.cpp
+++ b/src/session-widgets/auth_password.cpp
@@ -323,6 +323,8 @@ void AuthPassword::reset()
m_lineEdit->setAlert(false);
m_lineEdit->hideAlertMessage();
setFocusProxy(m_lineEdit);
+ m_lineEdit->setEchoMode(QLineEdit::Password);
+ m_passwordShowBtn->setIcon(QIcon(PASSWORD_SHOWN));
hidePasswordHintWidget();
setLineEditEnabled(true);
setLineEditInfo(tr("Password"), PlaceHolderText); |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Synchronize source files from linuxdeepin/dde-session-shell.
Source-pull-request: linuxdeepin/dde-session-shell#72
Summary by Sourcery
Enhancements: