From 7a468420c7a551cba35670e1e051586281a85d9d Mon Sep 17 00:00:00 2001 From: Saturneric Date: Tue, 7 Feb 2023 17:16:45 +0800 Subject: fix: solve an issue in version checking --- src/ui/struct/SoftwareVersion.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/ui/struct/SoftwareVersion.cpp') diff --git a/src/ui/struct/SoftwareVersion.cpp b/src/ui/struct/SoftwareVersion.cpp index a0ad594b..6a60cb02 100644 --- a/src/ui/struct/SoftwareVersion.cpp +++ b/src/ui/struct/SoftwareVersion.cpp @@ -34,12 +34,12 @@ int GpgFrontend::UI::SoftwareVersion::version_compare(const std::string& a, if (!temp_a.empty() && temp_a.front() == 'v') { temp_a = temp_a.erase(0, 1); - SPDLOG_INFO("real version a: {}", temp_a); + SPDLOG_DEBUG("real version a: {}", temp_a); } if (!temp_b.empty() && temp_b.front() == 'v') { temp_b.erase(0, 1); - SPDLOG_INFO("real version b: {}", temp_b); + SPDLOG_DEBUG("real version b: {}", temp_b); } // First, split the string. @@ -81,6 +81,12 @@ int GpgFrontend::UI::SoftwareVersion::version_compare(const std::string& a, } bool GpgFrontend::UI::SoftwareVersion::NeedUpgrade() const { + SPDLOG_DEBUG("compair version current {} latest {}, result {}", + current_version, latest_version, + version_compare(current_version, latest_version)); + + SPDLOG_DEBUG("load done: {}, pre-release: {}, draft: {}", load_info_done, + latest_prerelease, latest_draft); return load_info_done && !latest_prerelease && !latest_draft && version_compare(current_version, latest_version) < 0; } @@ -92,4 +98,4 @@ bool GpgFrontend::UI::SoftwareVersion::VersionWithDrawn() const { bool GpgFrontend::UI::SoftwareVersion::CurrentVersionReleased() const { return load_info_done && current_version_found; -} +} \ No newline at end of file -- cgit v1.2.3