diff options
Diffstat (limited to 'src/qdoc/qdocindexfiles.cpp')
-rw-r--r-- | src/qdoc/qdocindexfiles.cpp | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp index 9ea7d9f86..022d658b1 100644 --- a/src/qdoc/qdocindexfiles.cpp +++ b/src/qdoc/qdocindexfiles.cpp @@ -157,6 +157,11 @@ void QDocIndexFiles::readIndexFile(const QString &path) basesList_.clear(); NamespaceNode *root = qdb_->newIndexTree(project_); + if (!root) { + qWarning() << "Issue parsing index tree" << path; + return; + } + root->tree()->setIndexTitle(indexTitle); // Scan all elements in the XML file, constructing a map that contains @@ -387,7 +392,7 @@ void QDocIndexFiles::readIndexSection(QXmlStreamReader& reader, } else goto done; - if (current && current->isExample()) { + if (current->isExample()) { ExampleNode *en = static_cast<ExampleNode *>(current); if (subtype == QDocAttrFile) { en->appendFile(name); @@ -950,7 +955,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter &writer, Node *node, { // Classes contain information about their base classes. const ClassNode *classNode = static_cast<const ClassNode *>(node); - const QList<RelatedClass> bases = classNode->baseClasses(); + const QVector<RelatedClass> bases = classNode->baseClasses(); QSet<QString> baseStrings; for (const auto &related : bases) { ClassNode *n = related.node_; @@ -1445,14 +1450,12 @@ void QDocIndexFiles::generateFunctionSections(QXmlStreamWriter &writer, Aggregat { FunctionMap &functionMap = aggregate->functionMap(); if (!functionMap.isEmpty()) { - FunctionMap::iterator i = functionMap.begin(); - while (i != functionMap.end()) { - FunctionNode *fn = i.value(); + for (auto it = functionMap.begin(); it != functionMap.end(); ++it) { + FunctionNode *fn = it.value(); while (fn != nullptr) { generateFunctionSection(writer, fn); fn = fn->nextOverload(); } - i++; } } } @@ -1492,41 +1495,33 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter &writer, Node *node, */ const CNMap &groups = qdb_->groups(); if (!groups.isEmpty()) { - CNMap::ConstIterator g = groups.constBegin(); - while (g != groups.constEnd()) { - if (generateIndexSection(writer, g.value(), post)) + for (auto it = groups.constBegin(); it != groups.constEnd(); ++it) { + if (generateIndexSection(writer, it.value(), post)) writer.writeEndElement(); - ++g; } } const CNMap &modules = qdb_->modules(); if (!modules.isEmpty()) { - CNMap::ConstIterator g = modules.constBegin(); - while (g != modules.constEnd()) { - if (generateIndexSection(writer, g.value(), post)) + for (auto it = modules.constBegin(); it != modules.constEnd(); ++it) { + if (generateIndexSection(writer, it.value(), post)) writer.writeEndElement(); - ++g; } } const CNMap &qmlModules = qdb_->qmlModules(); if (!qmlModules.isEmpty()) { - CNMap::ConstIterator g = qmlModules.constBegin(); - while (g != qmlModules.constEnd()) { - if (generateIndexSection(writer, g.value(), post)) + for (auto it = qmlModules.constBegin(); it != qmlModules.constEnd(); ++it) { + if (generateIndexSection(writer, it.value(), post)) writer.writeEndElement(); - ++g; } } const CNMap &jsModules = qdb_->jsModules(); if (!jsModules.isEmpty()) { - CNMap::ConstIterator g = jsModules.constBegin(); - while (g != jsModules.constEnd()) { - if (generateIndexSection(writer, g.value(), post)) + for (auto it = jsModules.constBegin(); it != jsModules.constEnd(); ++it) { + if (generateIndexSection(writer, it.value(), post)) writer.writeEndElement(); - ++g; } } } |