GpgFrontend Project A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.

SoftwareVersion.h
1
29 #ifndef GPGFRONTEND_SOFTWAREVERSION_H
30 #define GPGFRONTEND_SOFTWAREVERSION_H
31
32 #include <boost/date_time.hpp>
33
34 namespace GpgFrontend::UI {
39 struct SoftwareVersion {
40 std::string latest_version;
41 std::string current_version;
42 bool latest_prerelease = false;
43 bool latest_draft = false;
44 bool current_prerelease = false;
45 bool current_draft = false;
46 bool load_info_done = false;
47 bool current_version_found = false;
48 std::string publish_date;
49 std::string release_note;
50
57 [[nodiscard]] bool NeedUpgrade() const {
58 return load_info_done && !latest_prerelease && !latest_draft &&
59 current_version < latest_version;
60 }
61
68 [[nodiscard]] bool VersionWithDrawn() const {
69 return load_info_done && !current_version_found && current_prerelease &&
70 !current_draft;
71 }
72
79 [[nodiscard]] bool CurrentVersionReleased() const {
80 return load_info_done && current_version_found;
81 }
82 };
83 } // namespace GpgFrontend::UI
84
85 #endif // GPGFRONTEND_SOFTWAREVERSION_H
GpgFrontend::UI
Definition: VerifyDetailsDialog.cpp:33
GpgFrontend::UI::SoftwareVersion
Definition: SoftwareVersion.h:39
GpgFrontend::UI::SoftwareVersion::VersionWithDrawn
bool VersionWithDrawn() const
Definition: SoftwareVersion.h:68
GpgFrontend::UI::SoftwareVersion::CurrentVersionReleased
bool CurrentVersionReleased() const
Definition: SoftwareVersion.h:79
GpgFrontend::UI::SoftwareVersion::NeedUpgrade
bool NeedUpgrade() const
Definition: SoftwareVersion.h:57