diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-08-06 12:30:42 (GMT) |
---|---|---|
committer | Toby Tomkins <toby.tomkins@nokia.com> | 2010-08-08 11:09:03 (GMT) |
commit | 134a37b2d24d41ab4b5c4b70a43e399584c633f3 (patch) | |
tree | 357b29df1e0f1b47842fc642bea89e7f7a01078f /tools | |
parent | 8fa3600f7449a931c919e0896633b7188e6d20f2 (diff) | |
download | Qt-134a37b2d24d41ab4b5c4b70a43e399584c633f3.zip Qt-134a37b2d24d41ab4b5c4b70a43e399584c633f3.tar.gz Qt-134a37b2d24d41ab4b5c4b70a43e399584c633f3.tar.bz2 |
doc: Re-introduced next/previous page links in the footer.
Task-Nr: QTBUG-12278
(cherry picked from commit 2118f407b02654e9e3c6706647e8b9b711e8982b)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 76d8c0d..e6396fe 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1882,6 +1882,61 @@ void HtmlGenerator::generateHeader(const QString& title, out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); } + navigationLinks.clear(); + + if (node && !node->links().empty()) { + QPair<QString,QString> linkPair; + QPair<QString,QString> anchorPair; + const Node *linkNode; + + if (node->links().contains(Node::PreviousLink)) { + linkPair = node->links()[Node::PreviousLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " <link rel=\"prev\" href=\"" + << anchorPair.first << "\" />\n"; + + navigationLinks += "[Previous: <a href=\"" + anchorPair.first + "\">"; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protect(anchorPair.second); + else + navigationLinks += protect(linkPair.second); + navigationLinks += "</a>]\n"; + } + if (node->links().contains(Node::NextLink)) { + linkPair = node->links()[Node::NextLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " <link rel=\"next\" href=\"" + << anchorPair.first << "\" />\n"; + + navigationLinks += "[Next: <a href=\"" + anchorPair.first + "\">"; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protect(anchorPair.second); + else + navigationLinks += protect(linkPair.second); + navigationLinks += "</a>]\n"; + } + if (node->links().contains(Node::StartLink)) { + linkPair = node->links()[Node::StartLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + out() << " <link rel=\"start\" href=\"" + << anchorPair.first << "\" />\n"; + } + } + #if 0 // Removed for new doc format. MWS if (node && !node->links().empty()) out() << "<p>\n" << navigationLinks << "</p>\n"; |