diff options
author | saturneric <[email protected]> | 2025-04-19 00:59:51 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-04-19 01:36:14 +0000 |
commit | d8d004fc73e6c2faaf823b23cb0fd4221aec0759 (patch) | |
tree | 9f7790c7a266f9122d18fdead98c2be3640fdf30 /src | |
parent | chore: update german and chinese translations (diff) | |
download | GpgFrontend-d8d004fc73e6c2faaf823b23cb0fd4221aec0759.tar.gz GpgFrontend-d8d004fc73e6c2faaf823b23cb0fd4221aec0759.zip |
fix: find pinentry under /app/bin in flatpak container
Diffstat (limited to 'src')
-rw-r--r-- | src/core/GpgCoreInit.cpp | 5 | ||||
-rw-r--r-- | src/core/utils/GpgUtils.cpp | 5 | ||||
-rw-r--r-- | src/ui/main_window/MainWindow.cpp | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp index b13a96a0..28635e52 100644 --- a/src/core/GpgCoreInit.cpp +++ b/src/core/GpgCoreInit.cpp @@ -497,9 +497,10 @@ auto InitGpgFrontendCore(CoreInitArgs args) -> int { auto auto_import_missing_key = settings.value("network/auto_import_missing_key", false).toBool(); + // force to use pinentry in flatpak container auto use_pinentry_as_password_input_dialog = - settings - .value("gnupg/use_pinentry_as_password_input_dialog", !IsFlatpakENV()) + IsFlatpakENV() || + settings.value("gnupg/use_pinentry_as_password_input_dialog", true) .toBool(); // unit test mode diff --git a/src/core/utils/GpgUtils.cpp b/src/core/utils/GpgUtils.cpp index c51b7e37..7098e47a 100644 --- a/src/core/utils/GpgUtils.cpp +++ b/src/core/utils/GpgUtils.cpp @@ -468,6 +468,11 @@ auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString { QStringList preferred_list = {"pinentry-qt"}; #endif + if (IsFlatpakENV()) { + LOG_D() << "set flatpak pinentry to /app/bin/pinentry-qt"; + return "/app/bin/pinentry-qt"; + } + for (const QString& name : preferred_list) { QString path = QStandardPaths::findExecutable(name); if (!path.isEmpty()) { diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp index 8c8fd55e..e2c4f1e3 100644 --- a/src/ui/main_window/MainWindow.cpp +++ b/src/ui/main_window/MainWindow.cpp @@ -120,7 +120,7 @@ void MainWindow::Init() noexcept { #if !(defined(_WIN32) || defined(WIN32)) connect(this, &MainWindow::SignalLoaded, this, [=]() { QTimer::singleShot(3000, [self = QPointer<MainWindow>(this)]() { - if (self != nullptr && DecidePinentry().isEmpty() && !IsFlatpakENV()) { + if (self != nullptr && DecidePinentry().isEmpty()) { QMessageBox::warning( self, tr("GUI Pinentry Not Found"), tr("No suitable *graphical* Pinentry program was found on your " |