diff options
author | Martin Smith <martin.smith@digia.com> | 2015-03-17 13:50:06 +0100 |
---|---|---|
committer | Martin Smith <martin.smith@digia.com> | 2015-03-27 13:55:44 +0000 |
commit | 6a5e2f69a898b0fca3ec75caeddac4a69803269f (patch) | |
tree | 1286a6ffdc45ed074a3525debe738420e80f1bd1 /src/tools/qdoc/qdocdatabase.cpp | |
parent | 58da6f96a84e6e140d384b2e422c0fdf020897ea (diff) |
qdoc: Update for classes in namespaces
The resolving of namespaces across module boundaries
was moving all the nodes for elements contained in the
namespace into the namespace node for the \namespace
command for that namespace. But moving class and
namespace nodes is wrong because they are actually in
different modules where they should also be output.
This update to the fix for the original bug leaves
the class and nested namespace nodes where they are
but adds them as special "orphan" nodes to the
namespace node that has the \namespace command.
These orphan nodes are then included in the namespace
content list when it is written out.
Change-Id: I0eee368ed39f28129b5b43bb4a16963961f53db3
Task-number: QTBUG-44688
Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/qdocdatabase.cpp')
-rw-r--r-- | src/tools/qdoc/qdocdatabase.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index a0b91a9c72..f1afb92eff 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -1310,11 +1310,24 @@ void QDocDatabase::resolveNamespaces() foreach (Node* n, nodes) { if (n->isNamespace()) { NamespaceNode* NS = static_cast<NamespaceNode*>(n); - if (NS != ns) { - while (!NS->childNodes().isEmpty()) { - Node* child = NS->childNodes().first(); - NS->removeChild(child); - ns->addChild(child); + if ((NS != ns) && !NS->childNodes().isEmpty()) { + const NodeList& children = NS->childNodes(); + int i = children.size() - 1; + while (i >= 0) { + Node* child = children.at(i--); + if (!child) + continue; + if (!child->isClass() + && !child->isQmlType() + && !child->isNamespace()) { + NS->removeChild(child); + ns->addChild(child); + } + else { + NS->setStatus(Node::Intermediate); + NS->setAccess(Node::Public); + ns->addOrphan(child); + } } } } |