aboutsummaryrefslogtreecommitdiffstats
path: root/src/module/integrated/version_checking_module/VersionCheckTask.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-10-18 14:45:33 +0000
committersaturneric <[email protected]>2023-10-18 14:45:33 +0000
commit70196cf01757824a578e4d9c49a210bf136de266 (patch)
treee058a59c6289b2a3872222c8822bae393cb7c213 /src/module/integrated/version_checking_module/VersionCheckTask.cpp
parentfix: solve build issues on macOS (diff)
downloadGpgFrontend-70196cf01757824a578e4d9c49a210bf136de266.tar.gz
GpgFrontend-70196cf01757824a578e4d9c49a210bf136de266.zip
feat: using pool for concurrent executions, not stable yet
Diffstat (limited to 'src/module/integrated/version_checking_module/VersionCheckTask.cpp')
-rw-r--r--src/module/integrated/version_checking_module/VersionCheckTask.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/module/integrated/version_checking_module/VersionCheckTask.cpp b/src/module/integrated/version_checking_module/VersionCheckTask.cpp
index b1e8eca8..a2a329f6 100644
--- a/src/module/integrated/version_checking_module/VersionCheckTask.cpp
+++ b/src/module/integrated/version_checking_module/VersionCheckTask.cpp
@@ -42,13 +42,12 @@ VersionCheckTask::VersionCheckTask()
current_version_(std::string("v") + std::to_string(VERSION_MAJOR) + "." +
std::to_string(VERSION_MINOR) + "." +
std::to_string(VERSION_PATCH)) {
+ HoldOnLifeCycle(true);
qRegisterMetaType<SoftwareVersion>("SoftwareVersion");
version_.current_version = current_version_;
}
void VersionCheckTask::Run() {
- HoldOnLifeCycle(true);
-
try {
using namespace nlohmann;
SPDLOG_DEBUG("current version: {}", current_version_);
@@ -66,7 +65,7 @@ void VersionCheckTask::Run() {
} catch (...) {
SPDLOG_ERROR("unknown error occurred");
- emit SignalTaskRunnableEnd(-1);
+ emit SignalTaskShouldEnd(-1);
}
}
@@ -130,7 +129,7 @@ void VersionCheckTask::slot_parse_latest_version_info() {
&VersionCheckTask::slot_parse_current_version_info);
} catch (...) {
SPDLOG_ERROR("current version request create error");
- emit SignalTaskRunnableEnd(-1);
+ emit SignalTaskShouldEnd(-1);
}
}
@@ -173,7 +172,7 @@ void VersionCheckTask::slot_parse_current_version_info() {
}
emit SignalUpgradeVersion(version_);
- emit SignalTaskRunnableEnd(0);
+ emit SignalTaskShouldEnd(0);
}
} // namespace GpgFrontend::Module::Integrated::VersionCheckingModule