summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/qdocindexfiles.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2014-01-31 11:56:10 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-31 21:04:52 +0200
commit5fecc6512f0e869713658502674665f9077cc340 (patch)
tree523f6ae6de75862b61694d9e090f62b42e5dff7d /src/tools/qdoc/qdocindexfiles.cpp
parente9954e31624c77d986077ec5431c7ec4a9b058e0 (diff)
qdoc: Teach qdoc to use multiple trees (part 2)
qdoc now knows how to search the forrest of node trees in an optimal order. But there remain some problems with specific searches that cross module boundaries. These include group membership and C++ and QML module membership, as well ass C++ base class resolution. Part 3 will be concerned with fixing these remaining bugs. With this update, qdoc now takes less time to generate the docs for Qt 5. Testing indicates that qdoc run time has dropped from about 14 minutes to about 7.5 minutes on an iMac. Task-number: QTBUG-35377 Change-Id: I6bded6ef54124b4f6e5914cad4548f0b600209b0 Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/qdocindexfiles.cpp')
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
index 55e580427f..8d33cdcdcd 100644
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ b/src/tools/qdoc/qdocindexfiles.cpp
@@ -77,6 +77,7 @@ QDocIndexFiles::QDocIndexFiles()
QDocIndexFiles::~QDocIndexFiles()
{
qdb_ = 0;
+ gen_ = 0;
}
/*!
@@ -109,10 +110,9 @@ void QDocIndexFiles::readIndexes(const QStringList& indexFiles)
foreach (const QString& indexFile, indexFiles) {
QString msg = "Loading index file: " + indexFile;
Location::logToStdErr(msg);
- //qDebug() << "READING INDEX:" << indexFile;
+ //qDebug() << " LOAD INDEX FILE:" << indexFile;
readIndexFile(indexFile);
}
- //qDebug() << "DONE READING INDEX FILES";
}
/*!
@@ -146,12 +146,13 @@ void QDocIndexFiles::readIndexFile(const QString& path)
basesList_.clear();
relatedList_.clear();
+ NamespaceNode* root = qdb_->newIndexTree(project_);
+
// Scan all elements in the XML file, constructing a map that contains
// base classes for each class found.
-
QDomElement child = indexElement.firstChildElement();
while (!child.isNull()) {
- readIndexSection(child, qdb_->treeRoot(), indexUrl);
+ readIndexSection(child, root, indexUrl);
child = child.nextSiblingElement();
}
@@ -523,7 +524,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
QString moduleName = element.attribute("module");
if (!moduleName.isEmpty())
- node->setModuleName(moduleName);
+ qdb_->addToModule(moduleName, node);
if (!href.isEmpty()) {
if (node->isExternalPage())
node->setUrl(href);
@@ -768,7 +769,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
QString objName = node->name();
// Special case: only the root node should have an empty name.
- if (objName.isEmpty() && node != qdb_->treeRoot())
+ if (objName.isEmpty() && node != qdb_->primaryTreeRoot())
return false;
writer.writeStartElement(nodeName);
@@ -1325,7 +1326,7 @@ void QDocIndexFiles::generateIndex(const QString& fileName,
writer.writeAttribute("version", qdb_->version());
writer.writeAttribute("project", g->config()->getString(CONFIG_PROJECT));
- generateIndexSections(writer, qdb_->treeRoot(), generateInternalNodes);
+ generateIndexSections(writer, qdb_->primaryTreeRoot(), generateInternalNodes);
/*
We wait until the end of the index file to output the group elements.