From 8f14fdc7325cb9635e3d92873baaa58f430fca01 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 18 Apr 2025 17:54:54 +0200 Subject: feat: add more info check --- src/core/function/gpg/GpgCommandExecutor.h | 70 ++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 4 deletions(-) (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 fd2181d3..046b61e4 100644 --- a/src/core/function/gpg/GpgCommandExecutor.h +++ b/src/core/function/gpg/GpgCommandExecutor.h @@ -51,12 +51,42 @@ class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor GpgCommandExecutorInterator int_func; Module::TaskRunnerPtr task_runner = nullptr; + /** + * @brief Construct a new Execute Context object + * + */ + ExecuteContext() = default; + + /** + * @brief Construct a new Execute Context object + * + * @param cmd + * @param arguments + * @param callback + * @param task_runner + * @param int_func + */ ExecuteContext( QString cmd, QStringList arguments, GpgCommandExecutorCallback callback = [](int, const QString &, const QString &) {}, Module::TaskRunnerPtr task_runner = nullptr, GpgCommandExecutorInterator int_func = [](QProcess *) {}); + + /** + * @brief Construct a new Execute Context object + * + * @param arguments + * @param callback + * @param task_runner + * @param int_func + */ + ExecuteContext( + QStringList arguments, + GpgCommandExecutorCallback callback = [](int, const QString &, + const QString &) {}, + Module::TaskRunnerPtr task_runner = nullptr, + GpgCommandExecutorInterator int_func = [](QProcess *) {}); }; using ExecuteContexts = QContainer; @@ -69,13 +99,45 @@ class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor * @param arguments Command parameters * @param interact_func Command answering function */ - static void ExecuteSync(ExecuteContext); + static void ExecuteSync(const ExecuteContext &); + + /** + * @brief + * + */ + static void ExecuteConcurrentlyAsync(const ExecuteContexts &); + + /** + * @brief + * + */ + static void ExecuteConcurrentlySync(const ExecuteContexts &); - static void ExecuteConcurrentlyAsync(ExecuteContexts); + /** + * @brief + * + */ + auto GpgExecuteSync(const ExecuteContext &) -> std::tuple; + + /** + * @brief + * + */ + auto GpgConfExecuteSync(const ExecuteContext &) -> std::tuple; - static void ExecuteConcurrentlySync(ExecuteContexts); + /** + * @brief + * + * @param context + */ + void GpgExecuteAsync(const ExecuteContext &); - void GpgExecuteSync(const ExecuteContext &); + /** + * @brief + * + * @param context + */ + void GpgConfExecuteAsync(const ExecuteContext &); private: GpgContext &ctx_ = -- cgit v1.2.3