aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-02-14 09:24:36 +0000
committersaturneric <[email protected]>2024-02-14 09:24:36 +0000
commit6f2e58c4024a3bdbc7dd2292d888cdb7c2ed3859 (patch)
tree657e45141ad0401d05643349a81890fb48652a55
parentfix: flathub doesn't support webp as screenshots (diff)
downloadGpgFrontend-6f2e58c4024a3bdbc7dd2292d888cdb7c2ed3859.tar.gz
GpgFrontend-6f2e58c4024a3bdbc7dd2292d888cdb7c2ed3859.zip
fix: use bundled pinentry as default in flatpak container
-rw-r--r--src/core/GpgCoreInit.cpp5
-rw-r--r--src/ui/dialog/gnupg/GnuPGControllerDialog.cpp4
-rw-r--r--src/ui/dialog/key_generate/KeygenDialog.cpp3
3 files changed, 9 insertions, 3 deletions
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp
index 3a56c02a..137a118b 100644
--- a/src/core/GpgCoreInit.cpp
+++ b/src/core/GpgCoreInit.cpp
@@ -319,7 +319,10 @@ void InitGpgFrontendCore(CoreInitArgs args) {
.toString();
auto use_pinentry_as_password_input_dialog =
- settings.value("gnupg/use_pinentry_as_password_input_dialog", true)
+ settings
+ .value(
+ "gnupg/use_pinentry_as_password_input_dialog",
+ QString::fromLocal8Bit(qgetenv("container")) != "flatpak")
.toBool();
GF_CORE_LOG_DEBUG("core loaded if use custom key databse path: {}",
diff --git a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp
index ea0a27c9..f1fa87e2 100644
--- a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp
+++ b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp
@@ -296,7 +296,9 @@ void GnuPGControllerDialog::set_settings() {
}
bool const use_pinentry_as_password_input_dialog =
- settings.value("gnupg/use_pinentry_as_password_input_dialog", true)
+ settings
+ .value("gnupg/use_pinentry_as_password_input_dialog",
+ QString::fromLocal8Bit(qgetenv("container")) != "flatpak")
.toBool();
if (use_pinentry_as_password_input_dialog) {
ui_->usePinentryAsPasswordInputDialogCheckBox->setCheckState(Qt::Checked);
diff --git a/src/ui/dialog/key_generate/KeygenDialog.cpp b/src/ui/dialog/key_generate/KeygenDialog.cpp
index 5251d15e..7585d6f0 100644
--- a/src/ui/dialog/key_generate/KeygenDialog.cpp
+++ b/src/ui/dialog/key_generate/KeygenDialog.cpp
@@ -141,7 +141,8 @@ void KeyGenDialog::slot_key_gen_accept() {
if (!GlobalSettingStation::GetInstance()
.GetSettings()
- .value("gnupg/use_pinentry_as_password_input_dialog", true)
+ .value("gnupg/use_pinentry_as_password_input_dialog",
+ QString::fromLocal8Bit(qgetenv("container")) != "flatpak")
.toBool() &&
!no_pass_phrase_check_box_->isChecked()) {
SetCacheValue("PinentryContext", "NEW_PASSPHRASE");