summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/qdocdatabase.h
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2015-06-09 10:59:10 +0200
committerTopi Reiniƶ <topi.reinio@digia.com>2015-07-24 10:36:03 +0000
commit7a85be3371b9022815fdb208ee05cb3d302b9cb7 (patch)
tree8c44355c29fa229b365bdeda0286e197bd031e81 /src/tools/qdoc/qdocdatabase.h
parent80dbdf0de3bfe5f0710a1c37932ef81cbdb5fbff (diff)
qdoc: Improve searching of collection nodes
QDocDatabase provided a way to search for a collection node in the primary tree only. This was insufficient for use cases where we want to list groups, C++ classes or QML types in other modules using the \generatelist or \annotatedlist commands. This commit does the following changes: - Add a function to find a collection node across all trees, use it for generating output for the list commands and generating C++ class/QML/JS type requisite tables. - Modify the code for \generatelist command to accept 'qmltypesbymodule' and 'jstypesbymodule' as parameters. - Modify constness of some functions to enable above changes. Change-Id: I3dbdadfd224754db4bdc1602a5ffab9d46c51f00 Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/qdocdatabase.h')
-rw-r--r--src/tools/qdoc/qdocdatabase.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
index 6154ec762b..5d55ea48e1 100644
--- a/src/tools/qdoc/qdocdatabase.h
+++ b/src/tools/qdoc/qdocdatabase.h
@@ -177,6 +177,16 @@ class QDocForest
return 0;
}
+ const CollectionNode* getCollectionNode(const QString& name, Node::Genus genus)
+ {
+ foreach (Tree* t, searchOrder()) {
+ const CollectionNode* cn = t->getCollection(name, genus);
+ if (cn)
+ return cn;
+ }
+ return 0;
+ }
+
QmlTypeNode* lookupQmlType(const QString& name)
{
foreach (Tree* t, searchOrder()) {
@@ -221,19 +231,11 @@ class QDocDatabase
Tree* findTree(const QString& t) { return forest_.findTree(t); }
- CollectionNode* getCollection(const QString& name, Node::Genus genus) {
- return primaryTree()->getCollection(name, genus);
- }
const CNMap& groups() { return primaryTree()->groups(); }
const CNMap& modules() { return primaryTree()->modules(); }
const CNMap& qmlModules() { return primaryTree()->qmlModules(); }
const CNMap& jsModules() { return primaryTree()->jsModules(); }
- CollectionNode* findGroup(const QString& name) { return primaryTree()->findGroup(name); }
- CollectionNode* findModule(const QString& name) { return primaryTree()->findModule(name); }
- CollectionNode* findQmlModule(const QString& name) { return primaryTree()->findQmlModule(name); }
- CollectionNode* findJsModule(const QString& name) { return primaryTree()->findJsModule(name); }
-
CollectionNode* addGroup(const QString& name) { return primaryTree()->addGroup(name); }
CollectionNode* addModule(const QString& name) { return primaryTree()->addModule(name); }
CollectionNode* addQmlModule(const QString& name) { return primaryTree()->addQmlModule(name); }
@@ -339,6 +341,9 @@ class QDocDatabase
Node* findNodeByNameAndType(const QStringList& path, Node::NodeType type) {
return forest_.findNodeByNameAndType(path, type);
}
+ const CollectionNode* getCollectionNode(const QString& name, Node::Genus genus) {
+ return forest_.getCollectionNode(name, genus);
+ }
private:
const Node* findNodeForTarget(QStringList& targetPath,