Enhance last used directory settings

* Use hash based storage for last used directories instead of a key/value for each type
* Explicitly declare certain operations as sensitive and follow the "Remember Last Database" setting for those.
* Introduce database backup directory location (close #6619)
This commit is contained in:
osx user 2021-07-06 00:00:38 +03:00 committed by Jonathan White
parent 5e68cd2fa2
commit 746276edea
13 changed files with 92 additions and 107 deletions

View file

@ -397,15 +397,15 @@ void ApplicationSettingsWidget::saveSettings()
// Security: clear storage if related settings are disabled
if (!config()->get(Config::RememberLastDatabases).toBool()) {
config()->remove(Config::LastDir);
config()->remove(Config::LastDatabases);
config()->remove(Config::LastActiveDatabase);
config()->remove(Config::LastAttachmentDir);
}
if (!config()->get(Config::RememberLastKeyFiles).toBool()) {
config()->remove(Config::LastDir);
config()->remove(Config::LastKeyFiles);
config()->remove(Config::LastChallengeResponse);
config()->remove(Config::LastDir);
}
for (const ExtraPage& page : asConst(m_extraPages)) {
@ -438,7 +438,6 @@ void ApplicationSettingsWidget::resetSettings()
// Clear recently used data
config()->remove(Config::LastDatabases);
config()->remove(Config::LastActiveDatabase);
config()->remove(Config::LastAttachmentDir);
config()->remove(Config::LastKeyFiles);
config()->remove(Config::LastDir);