diff options
author | saturneric <[email protected]> | 2024-01-08 09:26:41 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-08 09:26:41 +0000 |
commit | 5222a2fd1ba372f6eb67dc8fa71e334f1ff10bbb (patch) | |
tree | 7a868b8f56986083d5e0aa4c64cb74c34cdbf73f /src/ui/dialog/gnupg/GnuPGControllerDialog.cpp | |
parent | feat: remove save keys checked function (diff) | |
download | GpgFrontend-5222a2fd1ba372f6eb67dc8fa71e334f1ff10bbb.tar.gz GpgFrontend-5222a2fd1ba372f6eb67dc8fa71e334f1ff10bbb.zip |
fix: solve compile issue
Diffstat (limited to '')
-rw-r--r-- | src/ui/dialog/gnupg/GnuPGControllerDialog.cpp | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp index d2bbf07b..0c3af463 100644 --- a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp +++ b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp @@ -279,47 +279,33 @@ void GnuPGControllerDialog::slot_update_custom_gnupg_install_path_label( } void GnuPGControllerDialog::set_settings() { - auto& settings = GlobalSettingStation::GetInstance().GetMainSettings(); - - try { - bool non_ascii_when_export = - settings.lookup("general.non_ascii_when_export"); - GF_UI_LOG_DEBUG("non_ascii_when_export: {}", non_ascii_when_export); - if (non_ascii_when_export) - ui_->asciiModeCheckBox->setCheckState(Qt::Checked); - } catch (...) { - GF_UI_LOG_ERROR("setting operation error: non_ascii_when_export"); - } + auto& settings_station = GlobalSettingStation::GetInstance(); + + bool non_ascii_when_export = + settings_station.LookupSettings("general.non_ascii_when_export", true); + GF_UI_LOG_DEBUG("non_ascii_when_export: {}", non_ascii_when_export); + if (non_ascii_when_export) ui_->asciiModeCheckBox->setCheckState(Qt::Checked); - try { - bool use_custom_key_database_path = - settings.lookup("general.use_custom_key_database_path"); - if (use_custom_key_database_path) - ui_->keyDatabseUseCustomCheckBox->setCheckState(Qt::Checked); - } catch (...) { - GF_UI_LOG_ERROR("setting operation error: use_custom_key_database_path"); + bool const use_custom_key_database_path = settings_station.LookupSettings( + "general.use_custom_key_database_path", false); + if (use_custom_key_database_path) { + ui_->keyDatabseUseCustomCheckBox->setCheckState(Qt::Checked); } this->slot_update_custom_key_database_path_label( ui_->keyDatabseUseCustomCheckBox->checkState()); - try { - bool use_custom_gnupg_install_path = - settings.lookup("general.use_custom_gnupg_install_path"); - if (use_custom_gnupg_install_path) - ui_->useCustomGnuPGInstallPathCheckBox->setCheckState(Qt::Checked); - } catch (...) { - GF_UI_LOG_ERROR("setting operation error: use_custom_gnupg_install_path"); + bool const use_custom_gnupg_install_path = settings_station.LookupSettings( + "general.use_custom_gnupg_install_path", false); + if (use_custom_gnupg_install_path) { + ui_->useCustomGnuPGInstallPathCheckBox->setCheckState(Qt::Checked); } - try { - bool use_pinentry_as_password_input_dialog = - settings.lookup("general.use_pinentry_as_password_input_dialog"); - if (use_pinentry_as_password_input_dialog) - ui_->usePinentryAsPasswordInputDialogCheckBox->setCheckState(Qt::Checked); - } catch (...) { - GF_UI_LOG_ERROR( - "setting operation error: use_pinentry_as_password_input_dialog"); + bool const use_pinentry_as_password_input_dialog = + settings_station.LookupSettings( + "general.use_pinentry_as_password_input_dialog", false); + if (use_pinentry_as_password_input_dialog) { + ui_->usePinentryAsPasswordInputDialogCheckBox->setCheckState(Qt::Checked); } this->slot_update_custom_gnupg_install_path_label( |