fix: correctly save password on set or change

This commit is contained in:
MrMirDan
2025-12-19 13:24:51 +02:00
parent d8bf7d4d1a
commit 4c082654f9
4 changed files with 38 additions and 4 deletions
@@ -333,6 +333,26 @@ QString SettingsController::getHint()
return m_settings->getHint();
}
void SettingsController::setTempPassword(QString pwd)
{
tempPassword = pwd;
}
QString SettingsController::getTempPassword()
{
return tempPassword;
}
void SettingsController::setTempHint(QString hint)
{
tempHint = hint;
}
QString SettingsController::getTempHint()
{
return tempHint;
}
bool SettingsController::isScreenshotsEnabled()
{
return m_settings->isScreenshotsEnabled();
@@ -78,6 +78,11 @@ public slots:
void setHint(QString hint);
QString getHint();
void setTempPassword(QString pwd);
QString getTempPassword();
void setTempHint(QString hint);
QString getTempHint();
bool isScreenshotsEnabled();
void toggleScreenshotsEnabled(bool enable);
@@ -151,6 +156,9 @@ private:
QString getPlatform();
QString tempPassword;
QString tempHint;
QDateTime m_loggingDisableDate;
bool m_isDevModeEnabled = false;
@@ -125,8 +125,8 @@ PageType {
var _password = listView.itemAtIndex(vars.passwordIndex).children[0].textField.text
var _hint = listView.itemAtIndex(vars.hintIndex).children[0].textField.text
SettingsController.setPassword(_password)
SettingsController.setHint(_hint)
SettingsController.setTempPassword(_password)
SettingsController.setTempHint(_hint)
PageController.goToPage(PageEnum.PageSettingsAppPasswordConfirm)
if (root.isChangingPassword) {
@@ -108,7 +108,7 @@ PageType {
Layout.rightMargin: 16
Layout.bottomMargin: 24
text: SettingsController.getHint()
text: SettingsController.getTempHint()
}
BasicButtonType {
@@ -125,6 +125,12 @@ PageType {
return
}
SettingsController.setPassword(SettingsController.getTempPassword())
SettingsController.setHint(SettingsController.getTempHint())
SettingsController.setTempPassword("")
SettingsController.setTempHint("")
PageController.closePage()
PageController.goToPage(PageEnum.PageSettings)
PageController.goToPage(PageEnum.PageSettingsAppEncryption)
@@ -138,7 +144,7 @@ PageType {
var notMatch = false
var secretDataItem = listView.itemAtIndex(0).children[0]
if (secretDataItem.textField.text !== SettingsController.getPassword()) {
if (secretDataItem.textField.text !== SettingsController.getTempPassword()) {
secretDataItem.errorText = qsTr("Passwords not match")
notMatch = true
}