Commit 1891af4b authored by Eike Ziller's avatar Eike Ziller

Specify Qt Creator's "display version" in qtcreator.pri/qtc.qbs

Currently it is set by passing defines to qmake, which complicates
package build setups.
Set the display version where the numerical version is defined. This
also makes it available to developer builds. Also switch around the
display version and numerical version in the about dialog, since e.g.
"4.3.0-rc1" is more descriptive than "4.2.83".

Change-Id: I26dda427975acdc6cc169f8d625f57918167cf19
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 0dfd08b0
......@@ -4,6 +4,7 @@ import qbs.FileInfo
import "qtc.js" as HelperFunctions
Module {
property string qtcreator_display_version: '4.3.0-rc1'
property string ide_version_major: '4'
property string ide_version_minor: '2'
property string ide_version_release: '83'
......
......@@ -4,6 +4,7 @@ QTCREATOR_PRI_INCLUDED = 1
QTCREATOR_VERSION = 4.2.83
QTCREATOR_COMPAT_VERSION = 4.2.83
VERSION = $$QTCREATOR_VERSION
QTCREATOR_DISPLAY_VERSION = 4.3.0-rc1
BINARY_ARTIFACTS_BRANCH = 4.3
CONFIG += c++14
......
......@@ -33,21 +33,17 @@ namespace Constants {
#define IDE_VERSION $${QTCREATOR_VERSION}
#define IDE_VERSION_STR STRINGIFY(IDE_VERSION)
#define IDE_VERSION_DISPLAY_DEF $${QTCREATOR_DISPLAY_VERSION}
#define IDE_VERSION_MAJOR $$replace(QTCREATOR_VERSION, "^(\\d+)\\.\\d+\\.\\d+(-.*)?$", \\1)
#define IDE_VERSION_MINOR $$replace(QTCREATOR_VERSION, "^\\d+\\.(\\d+)\\.\\d+(-.*)?$", \\1)
#define IDE_VERSION_RELEASE $$replace(QTCREATOR_VERSION, "^\\d+\\.\\d+\\.(\\d+)(-.*)?$", \\1)
const char * const IDE_VERSION_LONG = IDE_VERSION_STR;
const char * const IDE_VERSION_DISPLAY = STRINGIFY(IDE_VERSION_DISPLAY_DEF);
const char * const IDE_AUTHOR = \"The Qt Company Ltd\";
const char * const IDE_YEAR = \"2017\";
#ifdef IDE_VERSION_DESCRIPTION
const char * const IDE_VERSION_DESCRIPTION_STR = STRINGIFY(IDE_VERSION_DESCRIPTION);
#else
const char * const IDE_VERSION_DESCRIPTION_STR = \"\";
#endif
#ifdef IDE_REVISION
const char * const IDE_REVISION_STR = STRINGIFY(IDE_REVISION);
#else
......@@ -67,7 +63,7 @@ const char * const IDE_COPY_SETTINGS_FROM_VARIANT_STR = STRINGIFY(IDE_COPY_SETTI
const char * const IDE_COPY_SETTINGS_FROM_VARIANT_STR = \"Nokia\";
#endif
#undef IDE_VERSION_DISPLAY_DEF
#undef IDE_VERSION
#undef IDE_VERSION_STR
#undef STRINGIFY
......
......@@ -32,6 +32,8 @@ Product {
if (onWindows)
content = content.replace(/\r\n/g, "\n");
// replace the magic qmake incantations
content = content.replace(/(\n#define IDE_VERSION_DISPLAY_DEF) .+\n/, "$1 "
+ product.moduleProperty("qtc", "qtcreator_display_version") + "\n");
content = content.replace(/(\n#define IDE_VERSION) .+\n/, "$1 "
+ product.moduleProperty("qtc", "qtcreator_version") + "\n");
content = content.replace(/(\n#define IDE_VERSION_MAJOR) .+\n/, "$1 "
......
......@@ -459,10 +459,9 @@ static QString compilerString()
QString ICore::versionString()
{
QString ideVersionDescription;
#ifdef IDE_VERSION_DESCRIPTION
ideVersionDescription = tr(" (%1)").arg(QLatin1String(Constants::IDE_VERSION_DESCRIPTION_STR));
#endif
return tr("Qt Creator %1%2").arg(QLatin1String(Constants::IDE_VERSION_LONG),
if (QLatin1String(Constants::IDE_VERSION_LONG) != QLatin1String(Constants::IDE_VERSION_DISPLAY))
ideVersionDescription = tr(" (%1)").arg(QLatin1String(Constants::IDE_VERSION_LONG));
return tr("Qt Creator %1%2").arg(QLatin1String(Constants::IDE_VERSION_DISPLAY),
ideVersionDescription);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment