aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/settings/SettingsAdvanced.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2023-04-05 05:16:26 +0000
committerSaturneric <[email protected]>2023-04-05 05:16:26 +0000
commit25dc98b395cbd4e60c468d82de7e2c7579350e58 (patch)
tree029683a56ad773aa915c32c93a1bf848def4a7a2 /src/ui/dialog/settings/SettingsAdvanced.cpp
parentfix: remove 'cached' in codeql ci (diff)
downloadGpgFrontend-25dc98b395cbd4e60c468d82de7e2c7579350e58.tar.gz
GpgFrontend-25dc98b395cbd4e60c468d82de7e2c7579350e58.zip
feat: simplify settings lookup
Diffstat (limited to '')
-rw-r--r--src/ui/dialog/settings/SettingsAdvanced.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/ui/dialog/settings/SettingsAdvanced.cpp b/src/ui/dialog/settings/SettingsAdvanced.cpp
index e10b5dd1..9a02f473 100644
--- a/src/ui/dialog/settings/SettingsAdvanced.cpp
+++ b/src/ui/dialog/settings/SettingsAdvanced.cpp
@@ -55,22 +55,15 @@ AdvancedTab::AdvancedTab(QWidget* parent) : QWidget(parent) {
}
void AdvancedTab::SetSettings() {
- auto& settings = GlobalSettingStation::GetInstance().GetUISettings();
- try {
- bool stegano_checked = settings.lookup("advanced.stegano_checked");
- if (stegano_checked) stegano_check_box_->setCheckState(Qt::Checked);
- } catch (...) {
- SPDLOG_ERROR("setting operation error: stegano_checked");
- }
+ int stegano_checked = GlobalSettingStation::GetInstance().LookupSettings(
+ "advanced.stegano_checked", false);
+ if (stegano_checked) stegano_check_box_->setCheckState(Qt::Checked);
- try {
- bool auto_pubkey_exchange_checked =
- settings.lookup("advanced.auto_pubkey_exchange_checked");
- if (auto_pubkey_exchange_checked)
- auto_pubkey_exchange_check_box_->setCheckState(Qt::Checked);
- } catch (...) {
- SPDLOG_ERROR("setting operation error: auto_pubkey_exchange_checked");
- }
+ int auto_pubkey_exchange_checked =
+ GlobalSettingStation::GetInstance().LookupSettings(
+ "advanced.auto_pubkey_exchange_checked", false);
+ if (auto_pubkey_exchange_checked)
+ auto_pubkey_exchange_check_box_->setCheckState(Qt::Checked);
}
void AdvancedTab::ApplySettings() {