Changes in version policy. Major.Minor.Debug.Distance.
Also now we save build revision number. --HG-- branch : develop
This commit is contained in:
parent
3febdd31fb
commit
56653c7943
|
@ -102,9 +102,10 @@ CONFIG(debug, debug|release){
|
|||
}
|
||||
}
|
||||
|
||||
#Calculate revision number only in release mode. Change revision number each time requare recompilation
|
||||
#precompiled headers file.
|
||||
DEFINES += "LOC_REV=0"
|
||||
#Calculate latest tag distance and build revision only in release mode. Change number each time requare
|
||||
#recompilation precompiled headers file.
|
||||
DEFINES += "LATEST_TAG_DISTANCE=0"
|
||||
DEFINES += "BUILD_REVISION=\\\"uknown\\\""
|
||||
}else{
|
||||
# Release mode
|
||||
DEFINES += V_NO_ASSERT
|
||||
|
@ -120,12 +121,19 @@ CONFIG(debug, debug|release){
|
|||
QMAKE_LFLAGS_RELEASE =
|
||||
}
|
||||
|
||||
#local revision number for using in version
|
||||
HG_REV=$$system(hg parents --template '{rev}')
|
||||
isEmpty(HG_REV){
|
||||
HG_REV = 0 # if we can't find local revision left 0.
|
||||
#latest tag distance number for using in version
|
||||
HG_DISTANCE=$$system(hg log -r tip --template '{latesttagdistance}')
|
||||
isEmpty(HG_DISTANCE){
|
||||
HG_DISTANCE = 0 # if we can't find local revision left 0.
|
||||
}
|
||||
DEFINES += "LOC_REV=$${HG_REV}" # Make available local revision number in sources.
|
||||
DEFINES += "LATEST_TAG_DISTANCE=$${HG_DISTANCE}" # Make available latest tag distance number in sources.
|
||||
|
||||
#build revision number for using in version
|
||||
HG_HESH=$$system("hg log -r tip --template '{node|short}'")
|
||||
isEmpty(HG_HESH){
|
||||
HG_HESH = "unknown" # if we can't find build revision left unknown.
|
||||
}
|
||||
DEFINES += "BUILD_REVISION=\\\"$${HG_HESH}\\\"" # Make available build revision number in sources.
|
||||
}
|
||||
|
||||
# Some extra information about Qt. Can be usefull.
|
||||
|
|
|
@ -41,7 +41,8 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) :
|
|||
ui->setupUi(this);
|
||||
|
||||
ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION));
|
||||
ui->label_QT_Version->setText(tr("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR));
|
||||
ui->labelBuildRevision->setText(QString("Build revision: %1").arg(BUILD_REVISION));
|
||||
ui->label_QT_Version->setText(buildCompatibilityString());
|
||||
|
||||
QDate date = QLocale(QLocale::C).toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
|
||||
ui->label_Valentina_Built->setText(tr("Built on %3 at %4").arg(date.toString()).arg(__TIME__));
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>393</width>
|
||||
<height>356</height>
|
||||
<width>583</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -21,14 +21,14 @@
|
|||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>393</width>
|
||||
<height>356</height>
|
||||
<width>573</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>393</width>
|
||||
<height>356</height>
|
||||
<width>583</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
|
@ -100,6 +100,19 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignHCenter">
|
||||
<widget class="QLabel" name="labelBuildRevision">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Build revision:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_Web_Site">
|
||||
<property name="palette">
|
||||
|
@ -175,35 +188,32 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="textBrowser_Contributors">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_Contributors">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="autoFormatting">
|
||||
<set>QTextEdit::AutoNone</set>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">dismine Sabine Schmaltz</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Susan Spencer grumpi</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Roman Telezhinsky Steve Conklin</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">luzpazB cosina</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Christine</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>false</bool>
|
||||
<property name="plainText">
|
||||
<string>Roman Telezhinskyi
|
||||
Susan Spencer
|
||||
luzpazB
|
||||
Christine Neupert
|
||||
Sabine Schmaltz
|
||||
grumpi
|
||||
Steve Conklin</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -220,6 +230,19 @@ p, li { white-space: pre-wrap; }
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_QT_Version">
|
||||
<property name="sizePolicy">
|
||||
|
@ -233,6 +256,19 @@ p, li { white-space: pre-wrap; }
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>45</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Legal_Stuff">
|
||||
<property name="text">
|
||||
|
|
|
@ -71,7 +71,8 @@ int main(int argc, char *argv[])
|
|||
app.StartLogging();
|
||||
|
||||
qDebug()<<"Version:"<<APP_VERSION;
|
||||
qDebug()<<"Based on Qt "<<QT_VERSION_STR<<"(32 bit)";
|
||||
qDebug()<<"Build revision:"<<BUILD_REVISION;
|
||||
qDebug()<<buildCompatibilityString();
|
||||
qDebug()<<"Built on"<<__DATE__<<"at"<<__TIME__;
|
||||
qDebug()<<"Command-line arguments:"<<app.arguments();
|
||||
qDebug()<<"Process ID:"<<app.applicationPid();
|
||||
|
|
|
@ -35,4 +35,32 @@ extern const int MINOR_VERSION = 2;
|
|||
extern const int DEBUG_VERSION = 8;
|
||||
|
||||
extern const QString APP_VERSION(QStringLiteral("%1.%2.%3.%4-alpha").arg(MAJOR_VERSION).arg(MINOR_VERSION)
|
||||
.arg(DEBUG_VERSION).arg(LOC_REV));
|
||||
.arg(DEBUG_VERSION).arg(LATEST_TAG_DISTANCE));
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString compilerString()
|
||||
{
|
||||
#if defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too
|
||||
QString isAppleString;
|
||||
#if defined(__apple_build_version__) // Apple clang has other version numbers
|
||||
isAppleString = QLatin1String(" (Apple)");
|
||||
#endif
|
||||
return QLatin1String("Clang " ) + QString::number(__clang_major__) + QLatin1Char('.')
|
||||
+ QString::number(__clang_minor__) + isAppleString;
|
||||
#elif defined(Q_CC_GNU)
|
||||
return QLatin1String("GCC " ) + QLatin1String(__VERSION__);
|
||||
#elif defined(Q_CC_MSVC)
|
||||
if (_MSC_VER >= 1800) // 1800: MSVC 2013 (yearly release cycle)
|
||||
return QLatin1String("MSVC ") + QString::number(2008 + ((_MSC_VER / 100) - 13));
|
||||
if (_MSC_VER >= 1500) // 1500: MSVC 2008, 1600: MSVC 2010, ... (2-year release cycle)
|
||||
return QLatin1String("MSVC ") + QString::number(2008 + 2 * ((_MSC_VER / 100) - 15));
|
||||
#endif
|
||||
return QLatin1String("<unknown compiler>");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString buildCompatibilityString()
|
||||
{
|
||||
return QCoreApplication::tr("Based on Qt %1 (%2, %3 bit)").arg(QLatin1String(qVersion()), compilerString(),
|
||||
QString::number(QSysInfo::WordSize));
|
||||
}
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
**
|
||||
*************************************************************************/
|
||||
|
||||
#include <QSysInfo>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
|
@ -56,4 +59,7 @@ extern const QString APP_VERSION;
|
|||
|
||||
#define VER_COMPANYDOMAIN_STR "www.valentina-project.org"
|
||||
|
||||
QString compilerString();
|
||||
QString buildCompatibilityString();
|
||||
|
||||
#endif // VERSION_H
|
||||
|
|
Loading…
Reference in New Issue
Block a user