From a83821b50d7c900e059f5950ba93df40eb32c6c2 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Wed, 27 Jul 2022 14:47:10 +0800
Subject: [PATCH] fix(kiran-cpanel-greeter): Fix invalid reset of automatic
 login option
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- 修复自动登录选项重置无效的问题

Closes #I5HBZO
---
 .../kiran-cpanel-greeter/src/greeter-setting-window.cpp     | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lightdm-greeter/kiran-cpanel-greeter/src/greeter-setting-window.cpp b/lightdm-greeter/kiran-cpanel-greeter/src/greeter-setting-window.cpp
index 8e27e7d..816322a 100644
--- a/lightdm-greeter/kiran-cpanel-greeter/src/greeter-setting-window.cpp
+++ b/lightdm-greeter/kiran-cpanel-greeter/src/greeter-setting-window.cpp
@@ -664,7 +664,13 @@ void GreeterSettingWindow::resetAutoLoginSettings()
 {
     GreeterSettingInfo::AutoLoginSetting autoLoginSetting = getAutologinSettingInfoFromBackend();
     m_autologinSwitch->setChecked(autoLoginSetting.autoLoginUser.size());
+    
     m_autologinComboWidget->setVisible(autoLoginSetting.autoLoginUser.size());
+    if( !autoLoginSetting.autoLoginUser.isEmpty() )
+    {
+        m_comboAutoLoginUser->setCurrentText(autoLoginSetting.autoLoginUser);
+    }
+
     m_editAutoLoginDelay->setText(QString::number(autoLoginSetting.autoLoginTimeout));
     m_origSettingInfo.autoLoginInfo = autoLoginSetting;
 }
-- 
2.33.0

