From 5bed7e7a86c8e45e3c18c9655b40812eb5d491a7 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 11 May 2014 21:03:01 +0300 Subject: [PATCH] Add local revision to version number. --HG-- branch : develop --- src/app/app.pro | 9 +++++++++ src/app/version.cpp | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/app.pro b/src/app/app.pro index 36a6c4786..f302a0b2b 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -134,6 +134,15 @@ message(Translation files: $$[QT_INSTALL_TRANSLATIONS]) message(Settings: $$[QT_INSTALL_SETTINGS]) message(Examples: $$[QT_INSTALL_EXAMPLES]) +#local revision number for using in version +!system(hg) { + DEFINES += LOCAL_REVISION=\\\"0\\\" +} +else +{ + DEFINES += LOCAL_REVISION=$$system(hg parents --template '{rev}') +} + win32:RC_FILE = share/resources/valentina.rc # Remove generated files at cleaning diff --git a/src/app/version.cpp b/src/app/version.cpp index dd8ffccbc..46287794c 100644 --- a/src/app/version.cpp +++ b/src/app/version.cpp @@ -32,6 +32,7 @@ extern const int MAJOR_VERSION = 0; extern const int MINOR_VERSION = 2; extern const int DEBUG_VERSION = 2; -extern const QString APP_VERSION(QStringLiteral("%1.%2.%3").arg(MAJOR_VERSION).arg(MINOR_VERSION).arg(DEBUG_VERSION)); +extern const QString APP_VERSION(QStringLiteral("%1.%2.%3.%4").arg(MAJOR_VERSION).arg(MINOR_VERSION).arg(DEBUG_VERSION) + .arg(LOCAL_REVISION)); extern const QString WARRANTY("The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE " "WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.");