diff options
author | Martin Smith <martin.smith@digia.com> | 2014-02-24 13:12:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-31 21:05:00 +0200 |
commit | a9d75c8eb86bd0fa68384091c1f0b02319146ae4 (patch) | |
tree | ef84525df16d1fdd6705f37c577af598c73de8e1 /src/tools/qdoc/cppcodeparser.cpp | |
parent | 5fecc6512f0e869713658502674665f9077cc340 (diff) |
qdoc: Teach qdoc to use multiple trees (part 3)
With this update, qdoc is now ready for testing
with multiple trees. In making this change to using
multiple trees, it has become clear that qdoc does
not really need trees the way it currently uses them.
Each C++ class or namespace, or QML type is naturally
a tree tree structure, but above that level, what we
currently call a tree in qdoc should really be called
a collection of maps. This change has moved qdoc in
that direction. It remains to replace the Tree class
with a class that encapsulates a set of maps, one for
each major node type. That can be implemented later.
Task-number: QTBUG-35377
Change-Id: I39068a0cb26c01f14ec0e4621742d727efb913bf
Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/cppcodeparser.cpp')
-rw-r--r-- | src/tools/qdoc/cppcodeparser.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index 73fe16fb46..d9a05cd111 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -458,25 +458,28 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, dn->setLocation(doc.startLocation()); return dn; } - else if (command == COMMAND_GROUP) { - DocNode* dn = qdb_->addGroup(arg.first); - dn->setLocation(doc.startLocation()); - return dn; - } else if (command == COMMAND_HEADERFILE) { DocNode* dn = new DocNode(qdb_->primaryTreeRoot(), arg.first, Node::HeaderFile, Node::ApiPage); dn->setLocation(doc.startLocation()); return dn; } + else if (command == COMMAND_GROUP) { + GroupNode* gn = qdb_->addGroup(arg.first); + gn->setLocation(doc.startLocation()); + gn->markSeen(); + return gn; + } else if (command == COMMAND_MODULE) { - DocNode* dn = qdb_->addModule(arg.first); - dn->setLocation(doc.startLocation()); - return dn; + ModuleNode* mn = qdb_->addModule(arg.first); + mn->setLocation(doc.startLocation()); + mn->markSeen(); + return mn; } else if (command == COMMAND_QMLMODULE) { - DocNode* dn = qdb_->addQmlModule(arg.first); - dn->setLocation(doc.startLocation()); - return dn; + QmlModuleNode* qmn = qdb_->addQmlModule(arg.first); + qmn->setLocation(doc.startLocation()); + qmn->markSeen(); + return qmn; } else if (command == COMMAND_PAGE) { Node::PageType ptype = Node::ArticlePage; |