aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-01-27 22:57:40 +0000
committersaturneric <[email protected]>2025-01-27 23:00:09 +0000
commitdbd145b5b6976aa59849d9553f6e90e91e01aec1 (patch)
treed352b57ff2e18ad621c75e3738900c4171c93b3d
parentrefactor: clean up code and reduce duplication (diff)
downloadGpgFrontend-dbd145b5b6976aa59849d9553f6e90e91e01aec1.tar.gz
GpgFrontend-dbd145b5b6976aa59849d9553f6e90e91e01aec1.zip
fix: tiny fixes
-rw-r--r--src/core/function/gpg/GpgAdvancedOperator.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/core/function/gpg/GpgAdvancedOperator.cpp b/src/core/function/gpg/GpgAdvancedOperator.cpp
index 0fb2861c..590110e9 100644
--- a/src/core/function/gpg/GpgAdvancedOperator.cpp
+++ b/src/core/function/gpg/GpgAdvancedOperator.cpp
@@ -32,6 +32,8 @@
#include "GpgAdvancedOperator.h"
+#include <utility>
+
#include "core/function/gpg/GpgCommandExecutor.h"
#include "core/module/ModuleManager.h"
#include "core/utils/GpgUtils.h"
@@ -84,40 +86,35 @@ void ExecuteGpgCommand(const QString &operation, const QStringList &extra_args,
}
void GpgAdvancedOperator::ClearGpgPasswordCache(OperationCallback cb) {
- ExecuteGpgCommand("Clear GPG Password Cache", {"--reload", "gpg-agent"}, cb);
+ ExecuteGpgCommand("Clear GPG Password Cache", {"--reload", "gpg-agent"},
+ std::move(cb));
}
void GpgAdvancedOperator::ReloadGpgComponents(OperationCallback cb) {
const auto gpgconf_path = Module::RetrieveRTValueTypedOrDefault<>(
"core", "gpgme.ctx.gpgconf_path", QString{});
- ExecuteGpgCommand("Reload GPG Components", {"--reload", "all"}, cb);
+ ExecuteGpgCommand("Reload GPG Components", {"--reload", "all"},
+ std::move(cb));
}
void GpgAdvancedOperator::KillAllGpgComponents(OperationCallback cb) {
- ExecuteGpgCommand("Kill All GPG Components", {"--kill", "all"}, cb);
+ ExecuteGpgCommand("Kill All GPG Components", {"--kill", "all"},
+ std::move(cb));
}
void GpgAdvancedOperator::ResetConfigures(OperationCallback cb) {
- ExecuteGpgCommand("Kill All GPG Components", {"--apply-defaults"}, cb);
+ ExecuteGpgCommand("Reset Gnupg Configures", {"--apply-defaults"},
+ std::move(cb));
}
void GpgAdvancedOperator::LaunchGpgComponents(OperationCallback cb) {
- ExecuteGpgCommand("Kill All GPG Components", {"--launch", "all"}, cb);
+ ExecuteGpgCommand("Launch All GPG Components", {"--launch", "all"},
+ std::move(cb));
}
void GpgAdvancedOperator::RestartGpgComponents(OperationCallback cb) {
- const auto gpgconf_path = Module::RetrieveRTValueTypedOrDefault<>(
- "core", "gpgme.ctx.gpgconf_path", QString{});
-
- if (gpgconf_path.isEmpty()) {
- FLOG_W("cannot get valid gpgconf path from rt, abort.");
- if (cb) cb(-1, TransferParams());
- return;
- }
-
KillAllGpgComponents(nullptr);
-
- LaunchGpgComponents(cb);
+ LaunchGpgComponents(std::move(cb));
}
} // namespace GpgFrontend \ No newline at end of file