aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgCommandExecutor.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-10-28 18:46:15 +0000
committersaturneric <[email protected]>2023-10-28 18:46:15 +0000
commitfd46d4667611c0db9cea3f06205727399b6fb5fd (patch)
tree8755059620d00d1690673d963cd0d913df92ae1c /src/core/function/gpg/GpgCommandExecutor.h
parentfeat: introduce clang-tidy config and modify clang-format config (diff)
downloadGpgFrontend-fd46d4667611c0db9cea3f06205727399b6fb5fd.tar.gz
GpgFrontend-fd46d4667611c0db9cea3f06205727399b6fb5fd.zip
refactor: start to tidy up code using clang-tidy
Diffstat (limited to 'src/core/function/gpg/GpgCommandExecutor.h')
-rw-r--r--src/core/function/gpg/GpgCommandExecutor.h33
1 files changed, 4 insertions, 29 deletions
diff --git a/src/core/function/gpg/GpgCommandExecutor.h b/src/core/function/gpg/GpgCommandExecutor.h
index fc9f2a83..f017fdfb 100644
--- a/src/core/function/gpg/GpgCommandExecutor.h
+++ b/src/core/function/gpg/GpgCommandExecutor.h
@@ -28,17 +28,7 @@
#pragma once
-#include <initializer_list>
-
#include "core/module/Module.h"
-#include "core/thread/TaskRunner.h"
-#ifndef WINDOWS
-#include <boost/process.hpp>
-#endif
-
-#include "core/GpgContext.h"
-#include "core/GpgFunctionObject.h"
-#include "core/thread/Task.h"
namespace GpgFrontend {
@@ -50,8 +40,7 @@ using GpgCommandExecutorInteractor = std::function<void(QProcess *)>;
* @brief Extra commands related to GPG
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor
- : public SingletonFunctionObject<GpgCommandExecutor> {
+class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor {
public:
struct ExecuteContext {
const std::string cmd;
@@ -71,30 +60,16 @@ class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor
using ExecuteContexts = std::vector<ExecuteContext>;
/**
- * @brief Construct a new Gpg Command Executor object
- *
- * @param channel Corresponding context
- */
- explicit GpgCommandExecutor(
- int channel = SingletonFunctionObject::GetDefaultChannel());
-
- /**
* @brief Excuting a command
*
* @param arguments Command parameters
* @param interact_func Command answering function
*/
- void ExecuteSync(ExecuteContext);
-
- void ExecuteConcurrentlyAsync(ExecuteContexts);
-
- void ExecuteConcurrentlySync(ExecuteContexts);
+ static void ExecuteSync(ExecuteContext);
- private:
- GpgContext &ctx_ = GpgContext::GetInstance(
- SingletonFunctionObject::GetChannel()); ///< Corresponding context
+ static void ExecuteConcurrentlyAsync(ExecuteContexts);
- Thread::Task *build_task_from_exec_ctx(const ExecuteContext &);
+ static void ExecuteConcurrentlySync(ExecuteContexts);
};
} // namespace GpgFrontend