diff options
author | saturneric <[email protected]> | 2024-02-29 10:15:57 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-02-29 10:15:57 +0000 |
commit | c1f5b3336836e15d193582e9b8f3e044f7d8bc1b (patch) | |
tree | 35e9edb2e8f0c80dbafb76cc05ad6fe92c2c11d0 /src/module/integrated/version_checking_module/VersionCheckTask.cpp | |
parent | feat: upgrade module system (diff) | |
download | GpgFrontend-c1f5b3336836e15d193582e9b8f3e044f7d8bc1b.tar.gz GpgFrontend-c1f5b3336836e15d193582e9b8f3e044f7d8bc1b.zip |
feat: add module controller and continue to work on module system
1. speed up building by reducing build info sheader including
2. add module controller
3. continue to work on module system
Diffstat (limited to 'src/module/integrated/version_checking_module/VersionCheckTask.cpp')
-rw-r--r-- | src/module/integrated/version_checking_module/VersionCheckTask.cpp | 9 |
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 91d5edff..eeb0231c 100644 --- a/src/module/integrated/version_checking_module/VersionCheckTask.cpp +++ b/src/module/integrated/version_checking_module/VersionCheckTask.cpp @@ -31,15 +31,14 @@ #include <QMetaType> #include <QtNetwork> -#include "GpgFrontendBuildInfo.h" +#include "core/utils/BuildInfoUtils.h" namespace GpgFrontend::Module::Integrated::VersionCheckingModule { VersionCheckTask::VersionCheckTask() : Task("version_check_task"), network_manager_(new QNetworkAccessManager(this)), - current_version_(QString("v") + VERSION_MAJOR + "." + VERSION_MINOR + - "." + VERSION_PATCH) { + current_version_(GetProjectVersion()) { HoldOnLifeCycle(true); qRegisterMetaType<SoftwareVersion>("SoftwareVersion"); version_.current_version = current_version_; @@ -53,7 +52,7 @@ auto VersionCheckTask::Run() -> int { QNetworkRequest latest_request(latest_version_url); latest_request.setHeader(QNetworkRequest::UserAgentHeader, - HTTP_REQUEST_USER_AGENT); + GetHttpRequestUserAgent()); latest_reply_ = network_manager_->get(latest_request); connect(latest_reply_, &QNetworkReply::finished, this, @@ -122,7 +121,7 @@ void VersionCheckTask::slot_parse_latest_version_info() { QNetworkRequest current_request(current_version_url); current_request.setHeader(QNetworkRequest::UserAgentHeader, - HTTP_REQUEST_USER_AGENT); + GetHttpRequestUserAgent()); current_reply_ = network_manager_->get(current_request); |