summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2019-01-22 13:20:47 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-01-23 15:42:14 +0000
commitf17ec3aac885cd347a3d3c6d74541a9aadc5fc78 (patch)
treeae3692c73b8ee5b5b3370104140254fa299d0ee3 /src/qdoc/cppcodeparser.cpp
parent8933c91ccb650930f72343340c15c847df35df25 (diff)
downloadqttools-f17ec3aac885cd347a3d3c6d74541a9aadc5fc78.tar.gz
QDoc: filter out internal nodes when processing args
CppCodeParser::processTopicArgs() neglected to check whether nodes are internal (or internals are to be included) before including them. Add Doc::isInternal() and CodeParser::showInternal() to let it check this and add the check. Tidied up surrounding code in the process. Change-Id: I9e1ca379a8e58c1519c345bbf98f441915998061 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index 83b989033..20341b769 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -1397,17 +1397,19 @@ void CppCodeParser::processTopicArgs(const Doc &doc, const QString &topic, NodeL
processQmlProperties(doc, nodes, docs, true);
} else {
ArgList args = doc.metaCommandArgs(topic);
- Node *node = 0;
+ Node *node = nullptr;
if (args.size() == 1) {
- if (topic == COMMAND_FN)
- node = parserForLanguage("Clang")->parseFnArg(doc.location(), args[0].first);
- else if (topic == COMMAND_MACRO)
+ if (topic == COMMAND_FN) {
+ if (showInternal() || !doc.isInternal())
+ node = parserForLanguage("Clang")->parseFnArg(doc.location(), args[0].first);
+ } else if (topic == COMMAND_MACRO) {
node = parseMacroArg(doc.location(), args[0].first);
- else if (isQMLMethodTopic(topic) || isJSMethodTopic(topic))
+ } else if (isQMLMethodTopic(topic) || isJSMethodTopic(topic)) {
node = parseOtherFuncArg(topic, doc.location(), args[0].first);
- else
+ } else {
node = processTopicCommand(doc, topic, args[0]);
- if (node != 0) {
+ }
+ if (node != nullptr) {
nodes.append(node);
docs.append(doc);
}
@@ -1415,15 +1417,18 @@ void CppCodeParser::processTopicArgs(const Doc &doc, const QString &topic, NodeL
QVector<SharedCommentNode*> sharedCommentNodes;
ArgList::ConstIterator arg = args.constBegin();
while (arg != args.constEnd()) {
- if (topic == COMMAND_FN)
- node = parserForLanguage("Clang")->parseFnArg(doc.location(), arg->first);
- else if (topic == COMMAND_MACRO)
+ node = nullptr;
+ if (topic == COMMAND_FN) {
+ if (showInternal() || !doc.isInternal())
+ node = parserForLanguage("Clang")->parseFnArg(doc.location(), arg->first);
+ } else if (topic == COMMAND_MACRO) {
node = parseMacroArg(doc.location(), arg->first);
- else if (isQMLMethodTopic(topic) || isJSMethodTopic(topic))
+ } else if (isQMLMethodTopic(topic) || isJSMethodTopic(topic)) {
node = parseOtherFuncArg(topic, doc.location(), arg->first);
- else
+ } else {
node = processTopicCommand(doc, topic, *arg);
- if (node != 0) {
+ }
+ if (node != nullptr) {
bool found = false;
for (SharedCommentNode *scn : sharedCommentNodes) {
if (scn->parent() == node->parent()) {