summaryrefslogtreecommitdiff
path: root/src/lib/corelib/tools/version.cpp
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-06-28 12:08:34 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-07-02 15:42:58 +0000
commit27e11e6e14ae9a00b757a7b1e2b438e0297c0cc0 (patch)
tree665f4c6a0a00363ee113fa20d3adb4aff12566e5 /src/lib/corelib/tools/version.cpp
parentacd61329b2401f8004254a062b325bd2dc4d150b (diff)
downloadqbs-27e11e6e14ae9a00b757a7b1e2b438e0297c0cc0.tar.gz
baremetal: Insert the version into auto-detected IAREW profile
This is useful in case we have installed a multiple toolchain versions. Change-Id: Ia6d5fa1be16199d5e5f1eea8a077fcb885ba42e6 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/tools/version.cpp')
-rw-r--r--src/lib/corelib/tools/version.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/corelib/tools/version.cpp b/src/lib/corelib/tools/version.cpp
index d2b337d3a..dfb7f49b7 100644
--- a/src/lib/corelib/tools/version.cpp
+++ b/src/lib/corelib/tools/version.cpp
@@ -105,13 +105,17 @@ Version Version::fromString(const QString &versionString, bool buildNumberAllowe
return Version{majorNr, minorNr, patchNr, buildNr};
}
-QString Version::toString() const
+QString Version::toString(const QChar &separator, const QChar &buildSeparator) const
{
if (m_build) {
- return QString(QStringLiteral("%1.%2.%3-%4"))
- .arg(m_major).arg(m_minor).arg(m_patch).arg(m_build);
+ return QStringLiteral("%1%5%2%5%3%6%4")
+ .arg(QString::number(m_major), QString::number(m_minor),
+ QString::number(m_patch), QString::number(m_build),
+ separator, buildSeparator);
}
- return QString(QStringLiteral("%1.%2.%3")).arg(m_major).arg(m_minor).arg(m_patch);
+ return QStringLiteral("%1%4%2%4%3")
+ .arg(QString::number(m_major), QString::number(m_minor),
+ QString::number(m_patch), separator);
}
int compare(const Version &lhs, const Version &rhs)