aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint/componentversion.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-01-22 13:12:56 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-02-03 15:22:12 +0100
commit789929f939a60462373beae37ab4373809095cff (patch)
treed3ee9dadb901213940ba61748f303fd34ccab424 /tools/qmllint/componentversion.cpp
parent8ba73c0134f162afd9aa83b731a8147728642385 (diff)
Use QTypeRevision for all versions and revisions
In many places we carry major and minor versions or revisions that are loosely coupled to minor versions. As the Qt minor version resets now, we need to handle these things more systematically. In particular, we need to add a "major" part to revisions. QTypeRevision can express the current major/minor pairs more efficiently and can also be used to add a major version to revisions. This change does not change the semantics, yet, but only replaces the types. Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint/componentversion.cpp')
-rw-r--r--tools/qmllint/componentversion.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/qmllint/componentversion.cpp b/tools/qmllint/componentversion.cpp
index e5047b8302..95403ec15f 100644
--- a/tools/qmllint/componentversion.cpp
+++ b/tools/qmllint/componentversion.cpp
@@ -41,21 +41,21 @@ ComponentVersion::ComponentVersion(const QString &versionString)
const int maybeMinor = versionString.midRef(dotIdx + 1).toInt(&ok);
if (!ok)
return;
- m_major = maybeMajor;
- m_minor = maybeMinor;
+ m_version = QTypeRevision::fromVersion(maybeMajor, maybeMinor);
}
bool operator<(const ComponentVersion &lhs, const ComponentVersion &rhs)
{
- return lhs.majorVersion() < rhs.majorVersion()
- || (lhs.majorVersion() == rhs.majorVersion() && lhs.minorVersion() < rhs.minorVersion());
+ return lhs.version().majorVersion() < rhs.version().majorVersion()
+ || (lhs.version().majorVersion() == rhs.version().majorVersion()
+ && lhs.version().minorVersion() < rhs.version().minorVersion());
}
bool operator<=(const ComponentVersion &lhs, const ComponentVersion &rhs)
{
- return lhs.majorVersion() < rhs.majorVersion()
- || (lhs.majorVersion() == rhs.majorVersion()
- && lhs.minorVersion() <= rhs.minorVersion());
+ return lhs.version().majorVersion() < rhs.version().majorVersion()
+ || (lhs.version().majorVersion() == rhs.version().majorVersion()
+ && lhs.version().minorVersion() <= rhs.version().minorVersion());
}
bool operator>(const ComponentVersion &lhs, const ComponentVersion &rhs)
@@ -70,8 +70,8 @@ bool operator>=(const ComponentVersion &lhs, const ComponentVersion &rhs)
bool operator==(const ComponentVersion &lhs, const ComponentVersion &rhs)
{
- return lhs.majorVersion() == rhs.majorVersion()
- && lhs.minorVersion() == rhs.minorVersion();
+ return lhs.version().majorVersion() == rhs.version().majorVersion()
+ && lhs.version().minorVersion() == rhs.version().minorVersion();
}
bool operator!=(const ComponentVersion &lhs, const ComponentVersion &rhs)