UI: Options: Fix password lock resetting

This commit is contained in:
Nodir Temirkhodjaev 2022-03-12 11:37:47 +03:00
parent 6bb1233e05
commit ec7c83e3fa
2 changed files with 4 additions and 4 deletions

View File

@ -83,6 +83,10 @@ void OptionsPage::onAboutToSave()
if (!settings()->hasPassword() && ini()->hasPassword() && ini()->password().isEmpty()) { if (!settings()->hasPassword() && ini()->hasPassword() && ini()->password().isEmpty()) {
m_cbPassword->setChecked(false); m_cbPassword->setChecked(false);
} }
if (!ini()->hasPassword()) {
settings()->resetCheckedPassword();
}
} else if (conf()->iniEdited()) { } else if (conf()->iniEdited()) {
ini()->setHasPassword(settings()->hasPassword()); ini()->setHasPassword(settings()->hasPassword());
} }

View File

@ -60,10 +60,6 @@ QString FortSettings::cacheFilePath() const
void FortSettings::setPassword(const QString &password) void FortSettings::setPassword(const QString &password)
{ {
setPasswordHash(StringUtil::cryptoHash(password)); setPasswordHash(StringUtil::cryptoHash(password));
if (!hasPassword()) {
resetCheckedPassword();
}
} }
bool FortSettings::checkPassword(const QString &password) const bool FortSettings::checkPassword(const QString &password) const