From a6b23476a2c38f2a2809cc4f80b3798a1e5c99a7 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sat, 19 Apr 2025 02:08:03 +0200 Subject: fix: gpg context will take response of gpg-agent --- src/core/function/gpg/GpgAdvancedOperator.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/core/function/gpg/GpgAdvancedOperator.cpp') diff --git a/src/core/function/gpg/GpgAdvancedOperator.cpp b/src/core/function/gpg/GpgAdvancedOperator.cpp index c9af8b59..d6323901 100644 --- a/src/core/function/gpg/GpgAdvancedOperator.cpp +++ b/src/core/function/gpg/GpgAdvancedOperator.cpp @@ -36,33 +36,27 @@ namespace GpgFrontend { auto GpgAdvancedOperator::ClearGpgPasswordCache() -> bool { - auto [ret, out] = exec_.GpgConfExecuteSync({{"--reload", "gpg-agent"}}); - return ret == 0; + return info_.ReloadGpgAgent(); } auto GpgAdvancedOperator::ReloadAllGpgComponents() -> bool { - auto [ret, out] = exec_.GpgConfExecuteSync({{"--reload", "all"}}); - return ret == 0; + return info_.ReloadGpgAgent(); } auto GpgAdvancedOperator::KillAllGpgComponents() -> bool { - auto [ret, out] = exec_.GpgConfExecuteSync({{"--kill", "all"}}); - return ret == 0; + return ctx_.RestartGpgAgent(); } auto GpgAdvancedOperator::ResetConfigures() -> bool { - auto [ret, out] = exec_.GpgConfExecuteSync({{"--apply-defaults"}}); - return ret == 0; + return info_.ReloadGpgAgent(); } auto GpgAdvancedOperator::LaunchAllGpgComponents() -> bool { - auto [ret, out] = exec_.GpgConfExecuteSync({{"--launch", "all"}}); - return ret == 0; + return ctx_.RestartGpgAgent(); } auto GpgAdvancedOperator::RestartGpgComponents() -> bool { - if (!KillAllGpgComponents()) return false; - return LaunchAllGpgComponents(); + return ctx_.RestartGpgAgent(); } GpgAdvancedOperator::GpgAdvancedOperator(int channel) -- cgit v1.2.3