diff options
author | saturneric <[email protected]> | 2024-04-11 18:26:29 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-04-11 18:26:29 +0000 |
commit | 8c758bacf40da3d228855f077fe7f16ee22f4c7d (patch) | |
tree | cfdbf8c54eb916d241009766c1dafe88d68d94fb | |
parent | docs: move manual out of repo (diff) | |
download | GpgFrontend-8c758bacf40da3d228855f077fe7f16ee22f4c7d.tar.gz GpgFrontend-8c758bacf40da3d228855f077fe7f16ee22f4c7d.zip |
fix: nothing changed is still triggering restart at gnupg controller
-rw-r--r-- | src/core/GpgConstants.h | 1 | ||||
-rw-r--r-- | src/ui/dialog/gnupg/GnuPGControllerDialog.cpp | 13 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/core/GpgConstants.h b/src/core/GpgConstants.h index c2125650..1c651ec1 100644 --- a/src/core/GpgConstants.h +++ b/src/core/GpgConstants.h @@ -30,6 +30,7 @@ namespace GpgFrontend { +constexpr int kNonRestartCode = 0; constexpr int kRestartCode = 1000; ///< only refresh ui constexpr int kDeepRestartCode = 1001; // refresh core and ui diff --git a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp index f1fa87e2..4614fed7 100644 --- a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp +++ b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp @@ -185,9 +185,6 @@ void GnuPGControllerDialog::SlotAccept() { void GnuPGControllerDialog::slot_update_custom_key_database_path_label( int state) { - // announce the restart - this->slot_set_restart_needed(kDeepRestartCode); - // hide label (not necessary to show the default path) this->ui_->currentKeyDatabasePathLabel->setHidden(state != Qt::CheckState::Checked); @@ -225,9 +222,6 @@ void GnuPGControllerDialog::slot_update_custom_key_database_path_label( void GnuPGControllerDialog::slot_update_custom_gnupg_install_path_label( int state) { - // announce the restart - this->slot_set_restart_needed(kDeepRestartCode); - // hide label (not necessary to show the default path) this->ui_->currentCustomGnuPGInstallPathLabel->setHidden( state != Qt::CheckState::Checked); @@ -310,13 +304,13 @@ void GnuPGControllerDialog::set_settings() { ui_->restartGpgAgentOnStartCheckBox->setCheckState(Qt::Checked); } - this->slot_set_restart_needed(false); - this->slot_update_custom_key_database_path_label( use_custom_key_database_path ? Qt::Checked : Qt::Unchecked); this->slot_update_custom_gnupg_install_path_label( use_custom_gnupg_install_path ? Qt::Checked : Qt::Unchecked); + + this->slot_set_restart_needed(kNonRestartCode); } void GnuPGControllerDialog::apply_settings() { @@ -341,11 +335,12 @@ void GnuPGControllerDialog::apply_settings() { ui_->restartGpgAgentOnStartCheckBox->isChecked()); } -int GnuPGControllerDialog::get_restart_needed() const { +auto GnuPGControllerDialog::get_restart_needed() const -> int { return this->restart_needed_; } void GnuPGControllerDialog::slot_set_restart_needed(int mode) { + GF_UI_LOG_INFO("announce restart needed, mode: {}", mode); this->restart_needed_ = mode; } |