diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2020-02-07 11:54:19 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2020-02-10 12:09:18 +0000 |
commit | 1a0af1ca226e55d353239b016d1ef1d4d1f70069 (patch) | |
tree | 2822e888f421c4f68120dd2eb8842022acc403f6 | |
parent | 6627cb2f3faa3b4dcec66e894c67d3fd2194c7c8 (diff) |
CMake Build: Let the version dialog log link point to the repo of origin
https://github.com/<qtcreator-fork>/commits/<sha>
Instead of expecting a "%1" placeholder in the passed-in
IDE_REVISION_URL_STR, we now expect IDE_REVISION_URL_STR to be a plain
URL.
Reason is that passing a string containing "%1" from CMake to the
VersionDialog caused a premature replacement of that placeholder
somewhere on the way.
Also log the CMake configure call in build_cmake.yml
Change-Id: I4c1a946c66f891101576e3556ca87a004cead950
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | .github/workflows/build_cmake.yml | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/plugins/coreplugin/versiondialog.cpp | 13 |
3 files changed, 10 insertions, 8 deletions
diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 7c86492849..1d2eeb5809 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -292,7 +292,9 @@ jobs: -D WITH_TESTS=ON -D IDE_REVISION=TRUE -D IDE_REVISION_STR=$ENV{GITHUB_SHA} + -D IDE_REVISION_URL_STR=https://github.com/$ENV{GITHUB_REPOSITORY}/commits/$ENV{GITHUB_SHA} RESULT_VARIABLE result + COMMAND_ECHO STDOUT ) if (NOT result EQUAL 0) message(FATAL_ERROR "Bad exit status") diff --git a/CMakeLists.txt b/CMakeLists.txt index c4077ac3e9..cb79a450f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,9 @@ include(QtCreatorIDEBranding) set(IDE_REVISION FALSE CACHE BOOL "Marks the presence of IDE revision string.") set(IDE_REVISION_STR "" CACHE STRING "The IDE revision string.") +set(IDE_REVISION_URL_STR "" CACHE STRING "The IDE revision Url string.") -mark_as_advanced(IDE_REVISION IDE_REVISION_STR) +mark_as_advanced(IDE_REVISION IDE_REVISION_STR IDE_REVISION_URL_STR) project(QtCreator VERSION ${IDE_VERSION}) diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index eb61275501..b1ef2edb10 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -58,13 +58,12 @@ VersionDialog::VersionDialog(QWidget *parent) QString ideRev; #ifdef IDE_REVISION - //: This gets conditionally inserted as argument %8 into the description string. - const QString revUrl = QString::fromLatin1(Constants::IDE_REVISION_URL_STR); - const QString rev = QString::fromLatin1(Constants::IDE_REVISION_STR); - ideRev = tr("<br/>From revision %1<br/>") - .arg(revUrl.isEmpty() ? rev.left(10) - : QString::fromLatin1("<a href=\"%1\">%2</a>") - .arg(revUrl.arg(rev), rev.left(10))); + //: This gets conditionally inserted as argument %8 into the description string. + const QString revUrl = QString::fromLatin1(Constants::IDE_REVISION_URL_STR); + const QString rev = QString::fromLatin1(Constants::IDE_REVISION_STR).left(10); + ideRev = tr("<br/>From revision %1<br/>") + .arg(revUrl.isEmpty() ? rev + : QString::fromLatin1("<a href=\"%1\">%2</a>").arg(revUrl, rev)); #endif QString buildDateInfo; #ifdef QTC_SHOW_BUILD_DATE |