mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
turns out the password code saving Configuration was useless anyways
would have avoided the bug I just "fixed"
This commit is contained in:
parent
2ca3269761
commit
7f12c267e1
|
@ -49,9 +49,6 @@ void Core::setPassword(QString& password, PasswordType passtype, uint8_t* salt)
|
||||||
tox_derive_key_from_pass(str.data(), str.size(), pwsaltedkeys[passtype]);
|
tox_derive_key_from_pass(str.data(), str.size(), pwsaltedkeys[passtype]);
|
||||||
|
|
||||||
password.clear();
|
password.clear();
|
||||||
|
|
||||||
if (passtype == ptMain)
|
|
||||||
saveConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::useOtherPassword(PasswordType type)
|
void Core::useOtherPassword(PasswordType type)
|
||||||
|
@ -73,9 +70,6 @@ void Core::clearPassword(PasswordType passtype)
|
||||||
delete[] pwsaltedkeys[passtype];
|
delete[] pwsaltedkeys[passtype];
|
||||||
pwsaltedkeys[passtype] = nullptr;
|
pwsaltedkeys[passtype] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (passtype == ptMain)
|
|
||||||
saveConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray Core::encryptData(const QByteArray& data, PasswordType passtype)
|
QByteArray Core::encryptData(const QByteArray& data, PasswordType passtype)
|
||||||
|
|
|
@ -114,11 +114,8 @@ void PrivacyForm::onEncryptLogsUpdated()
|
||||||
{
|
{
|
||||||
if (setChatLogsPassword())
|
if (setChatLogsPassword())
|
||||||
{
|
{
|
||||||
Settings::getInstance().setEncryptLogs(true);
|
|
||||||
bodyUI->cbEncryptHistory->setChecked(true);
|
bodyUI->cbEncryptHistory->setChecked(true);
|
||||||
// not logically necessary, but more consistent (esp. if the logic changes)
|
|
||||||
bodyUI->changeLogsPwButton->setEnabled(true);
|
bodyUI->changeLogsPwButton->setEnabled(true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -163,6 +160,9 @@ bool PrivacyForm::setToxPassword()
|
||||||
core->useOtherPassword(Core::ptMain);
|
core->useOtherPassword(Core::ptMain);
|
||||||
else
|
else
|
||||||
core->setPassword(newpw, Core::ptMain);
|
core->setPassword(newpw, Core::ptMain);
|
||||||
|
|
||||||
|
Settings::getInstance().setEncryptTox(true);
|
||||||
|
core->saveConfiguration();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -181,7 +181,6 @@ void PrivacyForm::onEncryptToxUpdated()
|
||||||
if (setToxPassword())
|
if (setToxPassword())
|
||||||
{
|
{
|
||||||
bodyUI->cbEncryptTox->setChecked(true);
|
bodyUI->cbEncryptTox->setChecked(true);
|
||||||
Settings::getInstance().setEncryptTox(true);
|
|
||||||
bodyUI->changeToxPwButton->setEnabled(true);
|
bodyUI->changeToxPwButton->setEnabled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user