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
4 changed files with 13 additions and 8 deletions
+8
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
+3 -7
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
+1 -1
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);