aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlplugindump/main.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-05 07:29:16 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-07 23:38:48 +0200
commit958cd3ee1094a068b6d0ff27c73a4b3caff088ad (patch)
tree6d3816fedf5dab2307675fd6ef70d39758e246f5 /tools/qmlplugindump/main.cpp
parente8e03215654ca730243336a80453cf9396cbdf58 (diff)
Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmlplugindump/main.cpp')
-rw-r--r--tools/qmlplugindump/main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 95dda5d612..9f39d1f2df 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -920,18 +920,18 @@ bool dependencyBetter(const QString &lhs, const QString &rhs)
if (leftModule > rightModule)
return false;
- if (leftSegments.length() == 1)
+ if (leftSegments.size() == 1)
return false;
- if (rightSegments.length() == 1)
+ if (rightSegments.size() == 1)
return true;
const QStringList leftVersion = leftSegments.at(1).split(QLatin1Char('.'));
const QStringList rightVersion = rightSegments.at(1).split(QLatin1Char('.'));
auto compareSegment = [&](int segmentIndex) {
- if (leftVersion.length() <= segmentIndex)
- return rightVersion.length() > segmentIndex ? 1 : 0;
- if (rightVersion.length() <= segmentIndex)
+ if (leftVersion.size() <= segmentIndex)
+ return rightVersion.size() > segmentIndex ? 1 : 0;
+ if (rightVersion.size() <= segmentIndex)
return -1;
bool leftOk = false;