diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-03-10 12:22:59 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-03-10 14:29:21 +0100 |
commit | 389c544adaf005d6f205486d0470ccaf945f19f0 (patch) | |
tree | 31b467dfd40eff463b78a5fe9856ed78ad65f330 /src | |
parent | 171ecb1c48326cf3b6abad1fad317ffa0975f799 (diff) |
qdoc: Fix regression in .index file output
Commit 5234c7fc fixed an issue with missing \inmodule commands,
but it ended up adding non-aggregates into the module as well
which was not the intention. This caused excess nodes being
listed as a module members, causing issues for the WebXML output
format as well.
Partially revert 5234c7fc, fix the issue correctly, and update
the test for .index files.
Change-Id: I85fc19152b3de8993f92361fbe1ad2fd934c79ae
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qdoc/codeparser.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/qdoc/codeparser.cpp b/src/qdoc/codeparser.cpp index db2d0df97..648a2de22 100644 --- a/src/qdoc/codeparser.cpp +++ b/src/qdoc/codeparser.cpp @@ -269,25 +269,28 @@ bool CodeParser::isParsingQdoc() const void CodeParser::checkModuleInclusion(Node *n) { if (n->physicalModuleName().isEmpty()) { - qdb_->addToModule(Generator::defaultModuleName(), n); - QString word; - switch (n->nodeType()) { - case Node::Class: - word = QLatin1String("Class"); - break; - case Node::Struct: - word = QLatin1String("Struct"); - break; - case Node::Union: - word = QLatin1String("Union"); - break; - case Node::Namespace: - word = QLatin1String("Namespace"); - break; - default: - return; - } + n->setPhysicalModuleName(Generator::defaultModuleName()); + if (n->isInAPI() && !n->name().isEmpty()) { + QString word; + switch (n->nodeType()) { + case Node::Class: + word = QLatin1String("Class"); + break; + case Node::Struct: + word = QLatin1String("Struct"); + break; + case Node::Union: + word = QLatin1String("Union"); + break; + case Node::Namespace: + word = QLatin1String("Namespace"); + break; + default: + return; + } + + qdb_->addToModule(Generator::defaultModuleName(), n); n->doc().location().warning(tr("%1 %2 has no \\inmodule command; " "using project name by default: %3") .arg(word) |