summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2022-04-06 11:58:48 +0200
committerTopi Reinio <topi.reinio@qt.io>2022-04-07 21:22:09 +0200
commit09dd127f67455dc88fc31300040102a99d3c5094 (patch)
tree887e4d5a98f38093c958762aee7783cb803eef8f /src/qdoc/cppcodeparser.cpp
parent463aed10c7b62fc03133a02e7d7d98bc750393d9 (diff)
downloadqttools-09dd127f67455dc88fc31300040102a99d3c5094.tar.gz
qdoc: Add warning for the location of duplicate-documented QML property
QDoc warned if a QML property was documented multiple times, but did not output the location of the previously seen doc entry. Display the previously seen comment location in warning details, and adjust similar warnings to the same format as they were previously emitting two warnings for a single problem. Pick-to: 6.3 Fixes: QTBUG-102332 Change-Id: Ib5d05a378bb8120d5d5cfe34681c5d90ed71ddcf Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index a32bb2b19..cce274a9b 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -449,7 +449,8 @@ void CppCodeParser::processQmlProperties(const Doc &doc, NodeList &nodes, DocLis
if (!doc.body().isEmpty()) {
doc.startLocation().warning(
QStringLiteral("QML property documented multiple times: '%1'")
- .arg(arg));
+ .arg(arg), QStringLiteral("also seen here: %1")
+ .arg(existingProperty->location().toString()));
}
continue;
}
@@ -810,8 +811,9 @@ FunctionNode *CppCodeParser::parseMacroArg(const Location &location, const QStri
macro->setReturnType(returnType);
macro->setParameters(params);
if (macro->compare(oldMacroNode)) {
- location.warning(QStringLiteral("\\macro %1 documented more than once").arg(macroArg));
- oldMacroNode->doc().location().warning(QStringLiteral("(The previous doc is here)"));
+ location.warning(QStringLiteral("\\macro %1 documented more than once")
+ .arg(macroArg), QStringLiteral("also seen here: %1")
+ .arg(oldMacroNode->doc().location().toString()));
}
return macro;
}