diff options
author | saturneric <[email protected]> | 2023-10-16 20:19:26 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-10-16 20:19:26 +0000 |
commit | 5175b3ae6687839afa2cdfe01f2fd70d714024ed (patch) | |
tree | 96eef7e087749c9118d5da7a838fdd81b0e96354 /src/core/function/gpg/GpgCommandExecutor.h | |
parent | feat: using piml tech on plugin system (diff) | |
download | GpgFrontend-5175b3ae6687839afa2cdfe01f2fd70d714024ed.tar.gz GpgFrontend-5175b3ae6687839afa2cdfe01f2fd70d714024ed.zip |
refactor: use c++17 features and piml tech to rewrite DataObject and Task
Diffstat (limited to 'src/core/function/gpg/GpgCommandExecutor.h')
-rw-r--r-- | src/core/function/gpg/GpgCommandExecutor.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/function/gpg/GpgCommandExecutor.h b/src/core/function/gpg/GpgCommandExecutor.h index a7259df8..1bad6d40 100644 --- a/src/core/function/gpg/GpgCommandExecutor.h +++ b/src/core/function/gpg/GpgCommandExecutor.h @@ -39,6 +39,10 @@ namespace GpgFrontend { +using GpgCommandExecutorCallback = + std::function<void(int, std::string, std::string)>; +using GpgCommandExecutorInteractor = std::function<void(QProcess *)>; + /** * @brief Extra commands related to GPG * @@ -62,14 +66,14 @@ class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor */ void Execute( std::string cmd, std::vector<std::string> arguments, - std::function<void(int, std::string, std::string)> callback = - [](int, std::string, std::string) {}, - std::function<void(QProcess *)> interact_func = [](QProcess *) {}); + GpgCommandExecutorCallback callback = [](int, std::string, + std::string) {}, + GpgCommandExecutorInteractor interact_func = [](QProcess *) {}); void ExecuteConcurrently( std::string cmd, std::vector<std::string> arguments, - std::function<void(int, std::string, std::string)> callback, - std::function<void(QProcess *)> interact_func = [](QProcess *) {}); + GpgCommandExecutorCallback callback, + GpgCommandExecutorInteractor interact_func = [](QProcess *) {}); private: GpgContext &ctx_ = GpgContext::GetInstance( |