From 3e7cf5981aa536c18aee814b9f5e221c5a8a4d1a Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 15 Apr 2015 14:14:30 +0200 Subject: [PATCH] qdoc: Resolve base classes for a class declared in a namespace For classes declared in a namespace, QDoc needs to take account the fact that its base classes typically are not qualified with the namespace name if those base classes are from the same namespace. There already was code for this, but it was disabled by a macro. This change re-enables it, and adds an additional check to restart the search in valid namespaces only. Change-Id: Ia07dcb783b59de5fc9ddcfd43000a63c6c74ebe1 Reviewed-by: Martin Smith --- src/tools/qdoc/tree.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index d0d0bcbb5a..420396e51c 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -388,7 +388,6 @@ void Tree::resolveInheritanceHelper(int pass, ClassNode* cn) while (b != bases.end()) { if (!(*b).node_) { Node* n = qdb_->findClassNode((*b).path_); -#if 0 /* If the node for the base class was not found, the reason might be that the subclass is in a @@ -401,9 +400,11 @@ void Tree::resolveInheritanceHelper(int pass, ClassNode* cn) */ if (!n) { InnerNode* parent = cn->parent(); - n = findClassNode((*b).path_, parent); + if (parent) + // Exclude the root namespace + if (parent->isNamespace() && !parent->name().isEmpty()) + n = findClassNode((*b).path_, parent); } -#endif if (n) { ClassNode* bcn = static_cast(n); (*b).node_ = bcn;