aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgCommandExecutor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/function/gpg/GpgCommandExecutor.h')
-rw-r--r--src/core/function/gpg/GpgCommandExecutor.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/function/gpg/GpgCommandExecutor.h b/src/core/function/gpg/GpgCommandExecutor.h
index 5a2f13db..fd2181d3 100644
--- a/src/core/function/gpg/GpgCommandExecutor.h
+++ b/src/core/function/gpg/GpgCommandExecutor.h
@@ -28,6 +28,8 @@
#pragma once
+#include "core/function/basic/GpgFunctionObject.h"
+#include "core/function/gpg/GpgContext.h"
#include "core/module/Module.h"
namespace GpgFrontend {
@@ -39,7 +41,8 @@ using GpgCommandExecutorInterator = std::function<void(QProcess *)>;
* @brief Extra commands related to GPG
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor {
+class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor
+ : public SingletonFunctionObject<GpgCommandExecutor> {
public:
struct GPGFRONTEND_CORE_EXPORT ExecuteContext {
QString cmd;
@@ -58,6 +61,8 @@ class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor {
using ExecuteContexts = QContainer<ExecuteContext>;
+ explicit GpgCommandExecutor(int channel = kGpgFrontendDefaultChannel);
+
/**
* @brief Excuting a command
*
@@ -69,6 +74,12 @@ class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor {
static void ExecuteConcurrentlyAsync(ExecuteContexts);
static void ExecuteConcurrentlySync(ExecuteContexts);
+
+ void GpgExecuteSync(const ExecuteContext &);
+
+ private:
+ GpgContext &ctx_ =
+ GpgContext::GetInstance(SingletonFunctionObject::GetChannel());
};
} // namespace GpgFrontend