From 09dd127f67455dc88fc31300040102a99d3c5094 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 6 Apr 2022 11:58:48 +0200 Subject: 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 --- src/qdoc/cppcodeparser.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/qdoc/cppcodeparser.cpp') 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; } -- cgit v1.2.1