aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-11-30 21:21:12 +0000
committersaturneric <[email protected]>2024-11-30 21:21:12 +0000
commit25f38e3b946ef847334c2a6c0d708127f4200a40 (patch)
treeb25f4983dc095fa37a3f6b897c2a9e285a5c4eda
parentfix: getting gpg-agent to start automatically on macOS (diff)
downloadGpgFrontend-25f38e3b946ef847334c2a6c0d708127f4200a40.tar.gz
GpgFrontend-25f38e3b946ef847334c2a6c0d708127f4200a40.zip
fix: solve discovered issues
-rw-r--r--src/core/GpgCoreInit.cpp12
-rw-r--r--src/ui/dialog/controller/GnuPGControllerDialog.cpp10
2 files changed, 17 insertions, 5 deletions
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp
index b9c29051..bcb57036 100644
--- a/src/core/GpgCoreInit.cpp
+++ b/src/core/GpgCoreInit.cpp
@@ -124,6 +124,16 @@ auto InitGpgME() -> bool {
return false;
}
+#if defined(_WIN32) || defined(WIN32)
+ auto w32spawn_dir =
+ GlobalSettingStation::GetInstance().GetAppDir() + "/../gnupg/bin";
+ if (gpgme_set_global_flag("w32-inst-dir", w32spawn_dir) != 0) {
+ LOG_E() << "gpgme_set_global_flag() with argument 'w32spawn_dir' failed, "
+ "abort...";
+ return false;
+ }
+#endif
+
if (CheckGpgError(
gpgme_set_locale(nullptr, LC_CTYPE, setlocale(LC_CTYPE, nullptr))) !=
GPG_ERR_NO_ERROR) {
@@ -317,7 +327,7 @@ auto DecideGpgConfPath(const QString& default_gpgconf_path) -> QString {
// check gpgconf path
gpgconf_install_fs_path = custom_gnupg_install_path;
#if defined(_WIN32) || defined(WIN32)
- gnupg_install_fs_path += "/gpgconf.exe";
+ gpgconf_install_fs_path += "/gpgconf.exe";
#else
gpgconf_install_fs_path += "/gpgconf";
#endif
diff --git a/src/ui/dialog/controller/GnuPGControllerDialog.cpp b/src/ui/dialog/controller/GnuPGControllerDialog.cpp
index d911d52e..72e9c276 100644
--- a/src/ui/dialog/controller/GnuPGControllerDialog.cpp
+++ b/src/ui/dialog/controller/GnuPGControllerDialog.cpp
@@ -70,8 +70,6 @@ GnuPGControllerDialog::GnuPGControllerDialog(QWidget* parent)
tr("Tips: notice that modify any of these settings will cause an "
"Application restart."));
-
-
popup_menu_ = new QMenu(this);
popup_menu_->addAction(ui_->actionMove_Key_Database_Up);
popup_menu_->addAction(ui_->actionMove_Key_Database_Down);
@@ -274,7 +272,9 @@ void GnuPGControllerDialog::set_settings() {
buffered_key_db_so_ = GetGpgKeyDatabaseInfos();
editable_key_db_so_ = buffered_key_db_so_;
- editable_key_db_so_.pop_front();
+ if (!editable_key_db_so_.isEmpty()) {
+ editable_key_db_so_.pop_front();
+ }
this->slot_refresh_key_database_table();
}
@@ -382,7 +382,9 @@ void GnuPGControllerDialog::slot_add_new_key_database() {
key_databases.append(key_database);
editable_key_db_so_ = buffered_key_db_so_;
- editable_key_db_so_.pop_front();
+ if (!editable_key_db_so_.isEmpty()) {
+ editable_key_db_so_.pop_front();
+ }
// refresh ui
slot_refresh_key_database_table();