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 <martin.smith@digia.com>
This commit is contained in:
Topi Reinio 2015-04-15 14:14:30 +02:00 committed by Topi Reiniö
parent b71535a923
commit 3e7cf5981a

View File

@ -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();
if (parent)
// Exclude the root namespace
if (parent->isNamespace() && !parent->name().isEmpty())
n = findClassNode((*b).path_, parent);
}
#endif
if (n) {
ClassNode* bcn = static_cast<ClassNode*>(n);
(*b).node_ = bcn;