aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgCommandExecutor.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-13 19:33:31 +0000
committersaturneric <[email protected]>2025-04-13 19:33:31 +0000
commit7ca18eb0e2c4204f749c682b66c862968e8d2f58 (patch)
treeba8e0303ebc6ec376b1be580408d9cd91f58f2d8 /src/core/function/gpg/GpgCommandExecutor.h
parentfeat: add openpgp smart card support (diff)
downloadGpgFrontend-7ca18eb0e2c4204f749c682b66c862968e8d2f58.tar.gz
GpgFrontend-7ca18eb0e2c4204f749c682b66c862968e8d2f58.zip
feat: add SmartCardController
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