From fd3976142ca2ec4fb555917cad92135a2070eb0b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 8 May 2017 10:48:15 +0200 Subject: qdoc: Better support for multi-\fn documentation blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change is a partial fix for the multi-\fn documentation concept. It outputs the documentation once but listing all the function signatures from the \fn commands found in the qdoc comment. Multiple \since commands are not implemented; the \until command is not implemented, and providing text applicable to a specific \fn signature is not implemented. This change requires clang, which means it requires a sequence of other updates as well, so you can't test it unless you have all that stuff. Task-number: QTBUG-60420 Change-Id: Ib316b6f97fa427ef730c4badfc785101bff55dce Reviewed-by: Topi Reiniƶ --- src/qdoc/clangcodeparser.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/qdoc/clangcodeparser.cpp') diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 18727ebde..3ef696367 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -1207,12 +1207,29 @@ void ClangCodeParser::parseSourceFile(const Location& /*location*/, const QStrin doc.location().warning(tr("Multiple topic commands found in comment: %1").arg(topicList)); } ArgList::ConstIterator a = args.constBegin(); + Node *node = 0; + SharedCommentNode* scn = 0; + int count = args.size(); while (a != args.constEnd()) { Doc nodeDoc = doc; - Node *node = processTopicCommand(nodeDoc, topic, *a); - if (node != 0) { - nodes.append(node); - docs.append(nodeDoc); + if ((count > 1) && (topic == COMMAND_FN)) { + node = processFnCommand(*a, doc); + if (node != 0) { + if (scn == 0) { + scn = new SharedCommentNode(node->parent(), count); + nodes.append(scn); + docs.append(nodeDoc); + } + scn->append(node); + node->setCollectiveNode(scn); + } + } + else { + node = processTopicCommand(nodeDoc, topic, *a); + if (node != 0) { + nodes.append(node); + docs.append(nodeDoc); + } } ++a; } -- cgit v1.2.1