From a9d75c8eb86bd0fa68384091c1f0b02319146ae4 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 24 Feb 2014 13:12:08 +0100 Subject: 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 --- src/tools/qdoc/cppcodeparser.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/tools/qdoc/cppcodeparser.cpp') diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index 73fe16fb46b..d9a05cd111e 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; -- cgit v1.2.3