From ba892305960b37846ee49a90c5684aa8dbfd3d72 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 28 Jun 2012 10:46:59 +0200 Subject: qdoc: Report multiple topic commands as an error Some documenters are using two topic commands in a single qdoc comment. This is only allowed for \qmlproperty so that multiple QML properties can be documented with a single comment. qdoc now reports an error for all other combinations of multiple topic commands. Task Nr: QTBUG-26345 Change-Id: I1f9a6d2502ccffa76c2d41f961be3750014a0a56 Reviewed-by: Casper van Donderen --- src/tools/qdoc/cppcodeparser.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/tools/qdoc/cppcodeparser.cpp') diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index 87374688442..f1a01e72f16 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -2268,6 +2268,19 @@ bool CppCodeParser::matchDocsAndStuff() } } else { + if (topicCommandsUsed.count() > 1) { + QString topics; + QSet::ConstIterator t = topicCommandsUsed.constBegin(); + while (t != topicCommandsUsed.constEnd()) { + topics += " \\" + *t + ","; + ++t; + } + topics[topics.lastIndexOf(',')] = '.'; + int i = topics.lastIndexOf(','); + topics[i] = ' '; + topics.insert(i+1,"and"); + doc.location().warning(tr("Multiple topic commands found in comment: %1").arg(topics)); + } ArgList::ConstIterator a = args.constBegin(); while (a != args.constEnd()) { Doc nodeDoc = doc; -- cgit v1.2.3