summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2014-10-02 15:48:08 +0200
committerTopi Reiniƶ <topi.reinio@digia.com>2014-10-08 12:47:19 +0200
commita366b2bb54c7020f1268c47bab438ccb0b06b0ef (patch)
tree9856f21591194e41a574678d36554cc37bf4b5f6
parentfa096c1123624abe7e994a97bafab643bbd2f9e6 (diff)
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>
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp
index aea05c1ab2..d0960e48bd 100644
--- a/src/tools/qdoc/helpprojectwriter.cpp
+++ b/src/tools/qdoc/helpprojectwriter.cpp
@@ -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())