qdoc: Recursively set the output subdirectory for InnerNode

When QDoc resolves and combines namespace child nodes located in
different modules to be under a single namespace node, it also changes
the output subdirectory of each child according to the destination
module.

However, if one of those child nodes is a namespace node or a class
node with nested child classes, the output subdir of those children is
left as the old (incorrect) directory.

This change fixes that by making the setOutputSubdirectory() function
recursive for nodes of type InnerNode.

Change-Id: I07b2f406283e1bf3bd8643797c3b789b0211b5bb
Reviewed-by: Martin Smith <martin.smith@digia.com>
bb10
Topi Reinio 2015-03-16 12:55:09 +01:00 committed by Martin Smith
parent 9a25fc5abb
commit 642b80e9e9
2 changed files with 12 additions and 1 deletions

View File

@ -1198,6 +1198,16 @@ void InnerNode::removeChild(Node *child)
child->setParent(0);
}
/*!
Recursively sets the output subdirectory for children
*/
void InnerNode::setOutputSubdirectory(const QString &t)
{
Node::setOutputSubdirectory(t);
for (int i = 0; i < childNodes().size(); ++i)
childNodes().at(i)->setOutputSubdirectory(t);
}
/*!
Find the module (Qt Core, Qt GUI, etc.) to which the class belongs.
We do this by obtaining the full path to the header file's location

View File

@ -319,7 +319,7 @@ public:
QmlTypeNode* qmlTypeNode();
ClassNode* declarativeCppNode();
const QString& outputSubdirectory() const { return outSubDir_; }
void setOutputSubdirectory(const QString& t) { outSubDir_ = t; }
virtual void setOutputSubdirectory(const QString& t) { outSubDir_ = t; }
QString fullDocumentName() const;
static QString cleanId(const QString &str);
QString idForNode() const;
@ -410,6 +410,7 @@ public:
void printChildren(const QString& title);
void addChild(Node* child);
void removeChild(Node* child);
virtual void setOutputSubdirectory(const QString& t);
protected:
InnerNode(Type type, InnerNode* parent, const QString& name);