summaryrefslogtreecommitdiff
path: root/src/lib/corelib/tools/version.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-07-01 15:42:25 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2016-07-07 13:43:45 +0000
commit105004b47eb43675613de6ec436c7495c86f4332 (patch)
treef5823cfeed178577908944c512a2c54baba5796e /src/lib/corelib/tools/version.cpp
parentcadb0864c99876b54fbdc46677cfb9d16162c096 (diff)
downloadqbs-105004b47eb43675613de6ec436c7495c86f4332.tar.gz
Allow to check for module version
Introduce a "version" property to the Module item and corresponding properties to the Depends item to set constraints on that version. [ChangeLog] Introduced the ability to check a module's version in a Depends item. Change-Id: I583b40216fb91af21f4e79ad403a7e327215ff79 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/tools/version.cpp')
-rw-r--r--src/lib/corelib/tools/version.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/corelib/tools/version.cpp b/src/lib/corelib/tools/version.cpp
index 8468d44e5..229b05b68 100644
--- a/src/lib/corelib/tools/version.cpp
+++ b/src/lib/corelib/tools/version.cpp
@@ -134,5 +134,19 @@ int compare(const Version &lhs, const Version &rhs)
return 0;
}
+VersionRange::VersionRange(const Version &minVersion, const Version &maxVersion)
+ : minimum(minVersion), maximum(maxVersion)
+{
+}
+
+VersionRange &VersionRange::narrowDown(const VersionRange &other)
+{
+ if (other.minimum > minimum)
+ minimum = other.minimum;
+ if (other.maximum.isValid() && other.maximum < maximum)
+ maximum = other.maximum;
+ return *this;
+}
+
} // namespace Internal
} // namespace qbs