summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-03-10 12:22:59 +0100
committerTopi Reinio <topi.reinio@qt.io>2020-03-10 14:29:21 +0100
commit389c544adaf005d6f205486d0470ccaf945f19f0 (patch)
tree31b467dfd40eff463b78a5fe9856ed78ad65f330
parent171ecb1c48326cf3b6abad1fad317ffa0975f799 (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>
-rw-r--r--src/qdoc/codeparser.cpp39
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testcpp.index2
2 files changed, 22 insertions, 19 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)
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index
index 36f8e72af..ae997fa52 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index
@@ -34,6 +34,6 @@
<function name="virtualFun" fullname="TestQDoc::TestDerived::virtualFun" href="testqdoc-testderived.html#virtualFun" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="true" type="void" signature="void virtualFun() override"/>
</class>
</namespace>
- <module name="TestCPP" href="testcpp-module.html" status="active" documented="true" seen="true" title="QDoc Test C++ Classes" module="TestCPP" members="TestCPP,TestQDoc,Test,TestDerived,QDOCTEST_MACRO,QDOCTEST_MACRO2,deprecatedMember,obsoleteMember,anotherObsoleteMember,someFunctionDefaultArg,someFunction,inlineFunction,virtualFun,virtualFun," brief="A test module page"/>
+ <module name="TestCPP" href="testcpp-module.html" status="active" documented="true" seen="true" title="QDoc Test C++ Classes" module="TestCPP" members="TestQDoc,Test,TestDerived" brief="A test module page"/>
</namespace>
</INDEX>