Organized version information (#3781)

added new `GIT_MODIFIED` variable - used to determine whether the vcs tree was compiled or not at the time of building the app
added information about running in DEBUG mode which might be very helpful to determine whether one is running a DEBUG build, e.g. in the process of troubleshooting/determining crash causes

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Kasia
2022-06-04 21:00:42 +02:00
committed by GitHub
parent a693bc23f8
commit a7939b727f
6 changed files with 145 additions and 83 deletions
+22
View File
@@ -26,19 +26,41 @@ public:
const QString &version() const;
const QString &commitHash() const;
// Whether or not the vcs tree had any changes at the time of build
const bool &isModified() const;
// Date of build file generation (≈ date of build)
const QString &dateOfBuild() const;
// "Full" version string, as displayed in window title
const QString &fullVersion() const;
const bool &isSupportedOS() const;
bool isFlatpak() const;
// Returns a list of tags for this build, e.g. what compiler was used, what Qt version etc
QStringList buildTags() const;
// Returns a string containing build information of this Chatterino binary
const QString &buildString() const;
// Returns a string about the current running system
const QString &runningString() const;
private:
Version();
QString version_;
QString commitHash_;
bool isModified_{false};
QString dateOfBuild_;
QString fullVersion_;
bool isSupportedOS_;
QString buildString_;
// Generate a build string (e.g. Chatterino 2.3.5 (commit ...)) and store it in buildString_ for future use
void generateBuildString();
QString runningString_;
// Generate a running string (e.g. Running on Arch Linux, kernel 5.14.3) and store it in runningString_ for future use
void generateRunningString();
};
}; // namespace chatterino