From 642b80e9e9a4e6068fe440f00239c6e1bb3249b1 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 16 Mar 2015 12:55:09 +0100 Subject: 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 --- src/tools/qdoc/node.cpp | 10 ++++++++++ src/tools/qdoc/node.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index a6999d3856..b2f93cc131 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -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 diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 654004e425..7dd868c3c0 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -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); -- cgit v1.2.3