fix: re-add build date to "About" page (#3464)

Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
This commit is contained in:
Leon Richardt 2022-01-07 17:25:57 +01:00 committed by GitHub
parent 1ba747efb1
commit 42002d80b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 8 deletions

View file

@ -79,6 +79,7 @@
- Bugfix: Fixed character counter changing fonts after going over the limit. (#3422)
- Bugfix: Fixed crash that could occur if the user opens/closes ChannelViews (e.g. EmotePopup, or Splits) then modifies the showLastMessageIndicator setting. (#3444)
- Bugfix: Removed ability to reload emotes really fast (#3450)
- Bugfix: Re-add date of build to the "About" page on nightly versions. (#3464)
- Dev: Batch checking live status for channels with live notifications that aren't connected. (#3442)
- Dev: Add GitHub action to test builds without precompiled headers enabled. (#3327)
- Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103)

View file

@ -593,6 +593,12 @@ set_target_properties(${LIBRARY_PROJECT}
AUTOUIC ON
)
# Used to provide a date of build in the About page (for nightly builds). Getting the actual time of
# compilation in CMake is a more involved, as documented in https://stackoverflow.com/q/24292898.
# For CI runs, however, the date of build file generation should be consistent with the date of
# compilation so this approximation is "good enough" for our purpose.
string(TIMESTAMP cmake_gen_date "%Y-%m-%d")
target_compile_definitions(${LIBRARY_PROJECT} PUBLIC
CHATTERINO
UNICODE
@ -604,6 +610,8 @@ target_compile_definitions(${LIBRARY_PROJECT} PUBLIC
CHATTERINO_GIT_HASH=\"${GIT_HASH}\"
CHATTERINO_GIT_RELEASE=\"${GIT_RELEASE}\"
CHATTERINO_GIT_COMMIT=\"${GIT_COMMIT}\"
CHATTERINO_CMAKE_GEN_DATE=\"${cmake_gen_date}\"
)
if (USE_SYSTEM_QTKEYCHAIN)
target_compile_definitions(${LIBRARY_PROJECT} PUBLIC

View file

@ -11,19 +11,15 @@ namespace chatterino {
Version::Version()
{
// Version
this->version_ = CHATTERINO_VERSION;
// Commit hash
this->commitHash_ =
QString(FROM_EXTERNAL_DEFINE(CHATTERINO_GIT_HASH)).remove('"');
// Date of build, this is depended on the format not changing
#ifdef CHATTERINO_NIGHTLY_VERSION_STRING
// Date of build file generation (≈ date of build)
#ifdef CHATTERINO_CMAKE_GEN_DATE
this->dateOfBuild_ =
QString(FROM_EXTERNAL_DEFINE(CHATTERINO_NIGHTLY_VERSION_STRING))
.remove('"')
.split(' ')[0];
QString(FROM_EXTERNAL_DEFINE(CHATTERINO_CMAKE_GEN_DATE)).remove('"');
#endif
// "Full" version string, as displayed in window title

View file

@ -93,7 +93,7 @@ AboutPage::AboutPage()
version.commitHash() + "\">" +
version.commitHash() + "</a>")
.arg(Modes::instance().isNightly
? ", " + version.dateOfBuild()
? ", built on " + version.dateOfBuild()
: "");
auto versionLabel = versionInfo.emplace<QLabel>(text);