aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgContext.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-07-27 12:22:01 +0000
committersaturneric <[email protected]>2024-07-27 12:22:01 +0000
commit0a61ccd17aec7712e42a47da04f0af367609dadd (patch)
treed11aabcb0f49696d1a4a13aa4ddc310cf4ce1793 /src/core/function/gpg/GpgContext.cpp
parentfeat: move pinentry out of source code (diff)
downloadGpgFrontend-0a61ccd17aec7712e42a47da04f0af367609dadd.tar.gz
GpgFrontend-0a61ccd17aec7712e42a47da04f0af367609dadd.zip
fix: do some clean up for removal of pinentry
Diffstat (limited to 'src/core/function/gpg/GpgContext.cpp')
-rw-r--r--src/core/function/gpg/GpgContext.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/function/gpg/GpgContext.cpp b/src/core/function/gpg/GpgContext.cpp
index d89ce92a..c6cb75da 100644
--- a/src/core/function/gpg/GpgContext.cpp
+++ b/src/core/function/gpg/GpgContext.cpp
@@ -145,12 +145,11 @@ class GpgContext::Impl {
"REQUEST_PIN_ENTRY",
{{"uid_hint", uid_hint != nullptr ? uid_hint : ""},
{"passphrase_info", passphrase_info != nullptr ? passphrase_info : ""},
- {"prev_was_bad", prev_was_bad ? "1" : "0"},
+ {"prev_was_bad", (prev_was_bad != 0) ? "1" : "0"},
{"ask_for_new", ask_for_new ? "1" : "0"}},
[&passphrase, &looper](Module::EventIdentifier i,
Module::Event::ListenerIdentifier ei,
Module::Event::Params p) {
- qCWarning(core) << "REQUEST_PIN_ENTRY callback: " << i << ei << p;
passphrase = p["passphrase"];
looper.quit();
});
@@ -159,7 +158,7 @@ class GpgContext::Impl {
ResetCacheValue("PinentryContext");
auto passphrase_size = passphrase.size();
- qCWarning(core, "get passphrase from pinentry size: %lld", passphrase_size);
+ qCDebug(core, "get passphrase from pinentry size: %lld", passphrase_size);
size_t res = 0;
if (passphrase_size > 0) {
@@ -280,7 +279,8 @@ class GpgContext::Impl {
qCWarning(core, "set passphrase cb failed, test");
return false;
};
- } else if (!args_.use_pinentry) {
+ } else if (!args_.use_pinentry &&
+ Module::IsModuleActivate(kPinentryModuleID)) {
if (!SetPassphraseCb(ctx, CustomPassphraseCb)) {
qCDebug(core, "set passphrase cb failed, custom");
return false;