From 7ca18eb0e2c4204f749c682b66c862968e8d2f58 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sun, 13 Apr 2025 21:33:31 +0200 Subject: feat: add SmartCardController --- src/core/function/gpg/GpgCommandExecutor.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/core/function/gpg/GpgCommandExecutor.h') 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; * @brief Extra commands related to GPG * */ -class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor { +class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor + : public SingletonFunctionObject { public: struct GPGFRONTEND_CORE_EXPORT ExecuteContext { QString cmd; @@ -58,6 +61,8 @@ class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor { using ExecuteContexts = QContainer; + 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 -- cgit v1.2.3