aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgCommandExecutor.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-10-16 20:19:26 +0000
committersaturneric <[email protected]>2023-10-16 20:19:26 +0000
commit5175b3ae6687839afa2cdfe01f2fd70d714024ed (patch)
tree96eef7e087749c9118d5da7a838fdd81b0e96354 /src/core/function/gpg/GpgCommandExecutor.h
parentfeat: using piml tech on plugin system (diff)
downloadGpgFrontend-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.h14
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(