diff options
author | Saturneric <[email protected]> | 2022-01-15 02:47:45 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-01-15 02:47:45 +0000 |
commit | c692b99171e38acc0b8a162bab4a5f3f5641aeb9 (patch) | |
tree | 839411cb304dd6ada05fef9780a994a3d7f3aa8b /src/ui/data_struct/SoftwareVersion.h | |
parent | <doc, refactor>(ci): Tidy up code of core and related parts (diff) | |
download | GpgFrontend-c692b99171e38acc0b8a162bab4a5f3f5641aeb9.tar.gz GpgFrontend-c692b99171e38acc0b8a162bab4a5f3f5641aeb9.zip |
<doc, refactor>(ui): Tidy up part of the code of ui and related parts
1. Rename related entities.
2. Add comments.
Diffstat (limited to 'src/ui/data_struct/SoftwareVersion.h')
-rw-r--r-- | src/ui/data_struct/SoftwareVersion.h | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/src/ui/data_struct/SoftwareVersion.h b/src/ui/data_struct/SoftwareVersion.h index be646b71..433eb99a 100644 --- a/src/ui/data_struct/SoftwareVersion.h +++ b/src/ui/data_struct/SoftwareVersion.h @@ -28,28 +28,50 @@ #include <boost/date_time.hpp> namespace GpgFrontend::UI { +/** + * @brief + * + */ struct SoftwareVersion { - std::string latest_version; - std::string current_version; - bool latest_prerelease = false; - bool latest_draft = false; - bool current_prerelease = false; - bool current_draft = false; - bool load_info_done = false; - bool current_version_found = false; - std::string publish_date; - std::string release_note; + std::string latest_version; ///< + std::string current_version; ///< + bool latest_prerelease = false; ///< + bool latest_draft = false; ///< + bool current_prerelease = false; ///< + bool current_draft = false; ///< + bool load_info_done = false; ///< + bool current_version_found = false; ///< + std::string publish_date; ///< + std::string release_note; ///< + /** + * @brief + * + * @return true + * @return false + */ [[nodiscard]] bool NeedUpgrade() const { return load_info_done && !latest_prerelease && !latest_draft && current_version < latest_version; } + /** + * @brief + * + * @return true + * @return false + */ [[nodiscard]] bool VersionWithDrawn() const { return load_info_done && !current_version_found && current_prerelease && !current_draft; } + /** + * @brief + * + * @return true + * @return false + */ [[nodiscard]] bool CurrentVersionReleased() const { return load_info_done && current_version_found; } |