summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-05 08:17:22 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-06 18:20:17 +0200
commitc338447261878111df7198fbd96051926464e865 (patch)
treed21b5af1efae225f75d5c05dfe370daefb1ea1d1 /src/qdoc/cppcodeparser.cpp
parent6495329e6de803025e6e4e8291b648f94893551c (diff)
downloadqttools-c338447261878111df7198fbd96051926464e865.tar.gz
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: I95f6410e57a6a92b1cf91bbedfbe3d517cab6b44 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index a0519fc8f..7cca45ca6 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -700,7 +700,7 @@ FunctionNode *CppCodeParser::parseOtherFuncArg(const QString &topic, const Locat
qsizetype firstBlank = funcName.indexOf(QChar(' '));
if (firstBlank > 0) {
returnType = funcName.left(firstBlank);
- funcName = funcName.right(funcName.length() - firstBlank - 1);
+ funcName = funcName.right(funcName.size() - firstBlank - 1);
}
QStringList colonSplit(funcName.split("::"));
@@ -774,7 +774,7 @@ FunctionNode *CppCodeParser::parseMacroArg(const Location &location, const QStri
params = afterParen.left(rightParen);
}
int i = 0;
- while (i < macroName.length() && !macroName.at(i).isLetter())
+ while (i < macroName.size() && !macroName.at(i).isLetter())
i++;
if (i > 0) {
returnType += QChar(' ') + macroName.left(i);
@@ -978,7 +978,7 @@ void CppCodeParser::processMetaCommands(NodeList &nodes, DocList &docs)
bool CppCodeParser::hasTooManyTopics(const Doc &doc) const
{
const QSet<QString> topicCommandsUsed = topicCommands() & doc.metaCommandsUsed();
- if (topicCommandsUsed.count() > 1) {
+ if (topicCommandsUsed.size() > 1) {
bool ok = true;
for (const auto &t : topicCommandsUsed) {
if (!t.startsWith(QLatin1String("qml")))