qdoc: Fix generation of qhp sections for unsorted pages

If you had the following lines in .qdocconf:

    qhp.QtFoo.subprojects.examples.title      = Examples
    qhp.QtFoo.subprojects.examples.indexTitle = Qt Foo Examples
    qhp.QtFoo.subprojects.examples.selectors  = fake:example

The expected outcome is to see an unsorted list of examples. This
didn't work however, because QDoc assumed to find a chain of
\nextpage links for the indexTitle, and these are rarely used
in Qt documentation nowadays.

This commit ensures that all pages matching the defined selectors
will be listed under the section title, even when the sortPages flag
is not set.

Task-number: QTBUG-41737
Change-Id: I1e7e2a2953de949c9b52763165c406a64d1d46f7
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
bb10
Topi Reinio 2014-10-02 15:48:08 +02:00 committed by Topi Reiniö
parent fa096c1123
commit a366b2bb54
1 changed files with 7 additions and 1 deletions

View File

@ -773,7 +773,7 @@ void HelpProjectWriter::generateProject(HelpProject &project)
} else {
// Find a contents node and navigate from there, using the NextLink values.
QSet<QString> visited;
bool contentsFound = false;
foreach (const Node *node, subproject.nodes) {
QString nextTitle = node->links().value(Node::NextLink).first;
if (!nextTitle.isEmpty() &&
@ -783,6 +783,7 @@ void HelpProjectWriter::generateProject(HelpProject &project)
// Write the contents node.
writeNode(project, writer, node);
contentsFound = true;
while (nextPage) {
writeNode(project, writer, nextPage);
@ -795,6 +796,11 @@ void HelpProjectWriter::generateProject(HelpProject &project)
break;
}
}
// No contents/nextpage links found, write all nodes unsorted
if (!contentsFound) {
foreach (const Node *node, subproject.nodes)
writeNode(project, writer, node);
}
}
if (!name.isEmpty())