aboutsummaryrefslogtreecommitdiffstats
path: root/src/module
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/module/integrated/version_checking_module/SoftwareVersion.cpp7
-rw-r--r--src/module/integrated/version_checking_module/VersionCheckTask.cpp6
2 files changed, 9 insertions, 4 deletions
diff --git a/src/module/integrated/version_checking_module/SoftwareVersion.cpp b/src/module/integrated/version_checking_module/SoftwareVersion.cpp
index 117212cb..e4077d65 100644
--- a/src/module/integrated/version_checking_module/SoftwareVersion.cpp
+++ b/src/module/integrated/version_checking_module/SoftwareVersion.cpp
@@ -32,7 +32,7 @@
namespace GpgFrontend::Module::Integrated::VersionCheckingModule {
-bool VersionCheckingModule::SoftwareVersion::NeedUpgrade() const {
+auto VersionCheckingModule::SoftwareVersion::NeedUpgrade() const -> bool {
MODULE_LOG_DEBUG("compair version current {} latest {}, result {}",
current_version, latest_version,
CompareSoftwareVersion(current_version, latest_version));
@@ -45,12 +45,13 @@ bool VersionCheckingModule::SoftwareVersion::NeedUpgrade() const {
CompareSoftwareVersion(current_version, latest_version) < 0;
}
-bool VersionCheckingModule::SoftwareVersion::VersionWithdrawn() const {
+auto VersionCheckingModule::SoftwareVersion::VersionWithdrawn() const -> bool {
return loading_done && !current_version_publish_in_remote &&
current_version_is_a_prerelease && !current_version_is_drafted;
}
-bool VersionCheckingModule::SoftwareVersion::CurrentVersionReleased() const {
+auto VersionCheckingModule::SoftwareVersion::CurrentVersionReleased() const
+ -> bool {
return loading_done && current_version_publish_in_remote;
}
} // namespace GpgFrontend::Module::Integrated::VersionCheckingModule \ No newline at end of file
diff --git a/src/module/integrated/version_checking_module/VersionCheckTask.cpp b/src/module/integrated/version_checking_module/VersionCheckTask.cpp
index 261ab1ca..34827838 100644
--- a/src/module/integrated/version_checking_module/VersionCheckTask.cpp
+++ b/src/module/integrated/version_checking_module/VersionCheckTask.cpp
@@ -101,6 +101,7 @@ void VersionCheckTask::slot_parse_latest_version_info() {
QString current_version_url =
"https://api.github.com/repos/saturneric/gpgfrontend/releases/tags/" +
current_version_;
+ MODULE_LOG_DEBUG("current version info query url: {}", current_version_url);
QNetworkRequest current_request;
current_request.setUrl(QUrl(current_version_url));
@@ -124,7 +125,11 @@ void VersionCheckTask::slot_parse_current_version_info() {
MODULE_LOG_ERROR(
"current version request network error, null reply object");
}
+
version_.current_version_publish_in_remote = false;
+
+ // loading done
+ version_.loading_done = true;
} else {
version_.current_version_publish_in_remote = true;
current_reply_bytes_ = current_reply_->readAll();
@@ -135,7 +140,6 @@ void VersionCheckTask::slot_parse_current_version_info() {
bool current_draft = current_reply_json["draft"].toBool();
version_.latest_prerelease_version_from_remote = current_prerelease;
version_.latest_draft_from_remote = current_draft;
-
// loading done
version_.loading_done = true;
} else {