diff options
author | saturneric <[email protected]> | 2023-10-18 09:49:06 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-10-18 09:49:06 +0000 |
commit | 216905e2532a79101e987e936fdf8b353b2a4dab (patch) | |
tree | 2b148028d738e8254a763b9814689679a66b21fc /src/core/thread/Task.cpp | |
parent | chore: fetch the latest release of the json library (diff) | |
download | GpgFrontend-216905e2532a79101e987e936fdf8b353b2a4dab.tar.gz GpgFrontend-216905e2532a79101e987e936fdf8b353b2a4dab.zip |
fix: improve thread and module relation
Diffstat (limited to 'src/core/thread/Task.cpp')
-rw-r--r-- | src/core/thread/Task.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/thread/Task.cpp b/src/core/thread/Task.cpp index e2d1138b..8793ea2d 100644 --- a/src/core/thread/Task.cpp +++ b/src/core/thread/Task.cpp @@ -41,7 +41,7 @@ class Task::Impl : public QObject { public: Impl(Task *parent, std::string name) - : parent_(parent), uuid_(generate_uuid()), name_(name) { + : QObject(parent), parent_(parent), uuid_(generate_uuid()), name_(name) { SPDLOG_TRACE("task {} created", GetFullID()); init(); } @@ -118,11 +118,11 @@ class Task::Impl : public QObject { * @brief * */ - void RunnableInterfaceRun() { + void DoRunning() { SPDLOG_TRACE("task {} starting", GetFullID()); // build runnable package for running - auto runnable_package = [=, id = GetFullID()]() { + auto runnable_package = [this, id = GetFullID()]() { SPDLOG_DEBUG("task {} runnable start runing", id); try { @@ -168,10 +168,10 @@ class Task::Impl : public QObject { * @brief * */ - void SlotRun() { RunnableInterfaceRun(); } + void SlotRun() { DoRunning(); } private: - Task *parent_; + Task *const parent_; const std::string uuid_; const std::string name_; const bool sequency_ = true; ///< must run in the same thread @@ -285,7 +285,7 @@ void Task::SlotRun() { p_->SlotRun(); } void Task::Run() { p_->Run(); } -void Task::run() { p_->RunnableInterfaceRun(); } +void Task::run() { p_->DoRunning(); } } // namespace GpgFrontend::Thread |