diff options
author | Martin Smith <msmith@trolltech.com> | 2010-04-13 13:36:25 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-04-16 09:30:24 (GMT) |
commit | b72d84bb7afc87253892ed853fcbaad502be0013 (patch) | |
tree | 316d65ba93099c6f2df4bd802b1c50b013e2d668 /tools | |
parent | 45c4ef4497b8fae5b441838c14d44d5c83263490 (diff) | |
download | Qt-b72d84bb7afc87253892ed853fcbaad502be0013.zip Qt-b72d84bb7afc87253892ed853fcbaad502be0013.tar.gz Qt-b72d84bb7afc87253892ed853fcbaad502be0013.tar.bz2 |
qdoc: Added TOC to module pages.
(cherry picked from commit 68eea9b1006074853a42853f9a34cc4eb1e04b8f)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 0c8209f..8beedb0 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2028,31 +2028,37 @@ void HtmlGenerator::generateTableOfContents(const Node *node, */ void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker) { - if (!node->doc().hasTableOfContents()) - return; + if (!node->doc().hasTableOfContents()) { + if (node->subType() != Node::Module) + return; + } QList<Atom *> toc = node->doc().tableOfContents(); - if (toc.isEmpty()) - return; + if (toc.isEmpty()) { + if (node->subType() != Node::Module) + return; + } Doc::SectioningUnit sectioningUnit = Doc::Section4; - QString nodeName = node->name(); - QStringList sectionNumber; - int columnSize = 0; // disable nested links in table of contents inContents = true; inLink = true; out() << "<div class=\"toc\">\n"; -#if 0 - if (moduleNamespaceMap.contains(fake->name())) { - out() << "<a name=\"" << registerRef("namespaces") << "\"></a>\n"; + sectionNumber.append("1"); + out() << "<ul class=\"level" << sectionNumber.size() << "\">\n"; + + if (node->subType() == Node::Module) { + if (moduleNamespaceMap.contains(node->name())) { + out() << "<li><a href=\"#" << registerRef("namespaces") << "\">Namespaces</a></li>\n"; } - if (moduleClassMap.contains(fake->name())) { - out() << "<a name=\"" << registerRef("classes") << "\"></a>\n"; + if (moduleClassMap.contains(node->name())) { + out() << "<li><a href=\"#" << registerRef("classes") << "\">Classes</a></li>\n"; } -#endif + out() << "<li><a href=\"#" << registerRef("details") << "\">Detailed Description</a></li>\n"; + } + for (int i = 0; i < toc.size(); ++i) { Atom *atom = toc.at(i); @@ -2082,8 +2088,6 @@ void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker << "\">"; generateAtomList(headingText.firstAtom(), node, marker, true, numAtoms); out() << "</a></li>\n"; - - ++columnSize; } while (!sectionNumber.isEmpty()) { out() << "</ul>\n"; |