summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/qdocdatabase.cpp
diff options
context:
space:
mode:
authorMartin Smith <[email protected]>2014-01-06 12:57:17 +0100
committerThe Qt Project <[email protected]>2014-03-31 21:04:43 +0200
commite9954e31624c77d986077ec5431c7ec4a9b058e0 (patch)
treece07acd32f8a03c07fa0f16cfc9ab186459c13fa /src/tools/qdoc/qdocdatabase.cpp
parent4f50be8d1885e685ec8df3796e4156eb015affa7 (diff)
qdoc: Teach qdoc to use multiple trees
qdoc now builds a separate Node Tree for each index file it parsed. The main Node Tree now contains only the Nodes of things being documented in the current module. This should make qdoc run a little faster. qdoc now uses these separate trees to make intra-module and inter-module linking more robust by searching the trees in an order that depends on the type of link it is searching for. The tree for the current module is always searched first. Then qdoc searches the trees for either the C++ modules or the QML modules, depending on whether it is looking for a C++ link or a QML link. In preparation for this update, qdoc was also simplified a lot. Many functions became obsolete and were removed. Others were combined. Task-number: QTBUG-35377 Change-Id: Iea4e49869ff6a6ff0f4d53090728770d40d892f3 Reviewed-by: Topi Reiniƶ <[email protected]>
Diffstat (limited to 'src/tools/qdoc/qdocdatabase.cpp')
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index 1011a3ac974..bbcb92c30d9 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -751,9 +751,7 @@ void QDocDatabase::resolveIssues() {
Searches the \a database for a node named \a target and returns
a pointer to it if found.
*/
-const Node* QDocDatabase::resolveTarget(const QString& target,
- const Node* relative,
- const Node* self)
+const Node* QDocDatabase::resolveTarget(const QString& target, const Node* relative)
{
const Node* node = 0;
if (target.endsWith("()")) {
@@ -776,7 +774,7 @@ const Node* QDocDatabase::resolveTarget(const QString& target,
else {
QStringList path = target.split("::");
int flags = SearchBaseClasses | SearchEnumValues | NonFunction;
- node = tree_->findNode(path, relative, flags, self);
+ node = tree_->findNode(path, relative, flags);
}
return node;
}
@@ -790,8 +788,9 @@ const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* r
const Node* node = 0;
if (target.isEmpty())
node = relative;
- else if (target.endsWith(".html"))
- node = tree_->root()->findChildNodeByNameAndType(target, Node::Document);
+ else if (target.endsWith(".html")) {
+ node = findNodeByNameAndType(QStringList(target), Node::Document, Node::NoSubType);
+ }
else {
node = resolveTarget(target, relative);
if (!node)