aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgCommandExecutor.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-12 06:02:37 +0000
committersaturneric <[email protected]>2024-01-12 06:02:37 +0000
commitbf538056b24a68b8fd235b1c50991ee8eb46a776 (patch)
treee1bab54095b80df62b321fb5bd69453f9f951b05 /src/core/function/gpg/GpgCommandExecutor.h
parentfeat: improve api and ui of keys import and export (diff)
downloadGpgFrontend-bf538056b24a68b8fd235b1c50991ee8eb46a776.tar.gz
GpgFrontend-bf538056b24a68b8fd235b1c50991ee8eb46a776.zip
refactor: use QString instead of std::string and improve threading system
Diffstat (limited to 'src/core/function/gpg/GpgCommandExecutor.h')
-rw-r--r--src/core/function/gpg/GpgCommandExecutor.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/function/gpg/GpgCommandExecutor.h b/src/core/function/gpg/GpgCommandExecutor.h
index f017fdfb..995fb603 100644
--- a/src/core/function/gpg/GpgCommandExecutor.h
+++ b/src/core/function/gpg/GpgCommandExecutor.h
@@ -32,8 +32,7 @@
namespace GpgFrontend {
-using GpgCommandExecutorCallback =
- std::function<void(int, std::string, std::string)>;
+using GpgCommandExecutorCallback = std::function<void(int, QString, QString)>;
using GpgCommandExecutorInteractor = std::function<void(QProcess *)>;
/**
@@ -43,21 +42,21 @@ using GpgCommandExecutorInteractor = std::function<void(QProcess *)>;
class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor {
public:
struct ExecuteContext {
- const std::string cmd;
- const std::vector<std::string> arguments;
- const GpgCommandExecutorCallback cb_func;
- const GpgCommandExecutorInteractor int_func;
+ QString cmd;
+ QList<QString> arguments;
+ GpgCommandExecutorCallback cb_func;
+ GpgCommandExecutorInteractor int_func;
Module::TaskRunnerPtr task_runner = nullptr;
ExecuteContext(
- std::string cmd, std::vector<std::string> arguments,
- GpgCommandExecutorCallback callback = [](int, std::string,
- std::string) {},
+ QString cmd, QList<QString> arguments,
+ GpgCommandExecutorCallback callback = [](int, const QString &,
+ const QString &) {},
Module::TaskRunnerPtr task_runner = nullptr,
GpgCommandExecutorInteractor int_func = [](QProcess *) {});
};
- using ExecuteContexts = std::vector<ExecuteContext>;
+ using ExecuteContexts = QList<ExecuteContext>;
/**
* @brief Excuting a command