diff options
author | Martin Smith <martin.smith@nokia.com> | 2012-06-28 10:46:59 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-28 12:35:14 +0200 |
commit | ba892305960b37846ee49a90c5684aa8dbfd3d72 (patch) | |
tree | 1e4d6da961448ef7d9d155421c3d5dc4a3a7aa6c /src/tools/qdoc/cppcodeparser.cpp | |
parent | a85759f07799ca57ffb436f103b863073cee315c (diff) |
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 <casper.vandonderen@nokia.com>
Diffstat (limited to 'src/tools/qdoc/cppcodeparser.cpp')
-rw-r--r-- | src/tools/qdoc/cppcodeparser.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index 8737468844..f1a01e72f1 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<QString>::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; |