From 68eea9b1006074853a42853f9a34cc4eb1e04b8f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 13 Apr 2010 15:36:25 +0200 Subject: qdoc: Added TOC to module pages. --- tools/qdoc3/htmlgenerator.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index e6e2127..508c83a 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2030,31 +2030,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 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() << "
\n"; -#if 0 - if (moduleNamespaceMap.contains(fake->name())) { - out() << "\n"; + sectionNumber.append("1"); + out() << "
    \n"; + + if (node->subType() == Node::Module) { + if (moduleNamespaceMap.contains(node->name())) { + out() << "
  • Namespaces
  • \n"; } - if (moduleClassMap.contains(fake->name())) { - out() << "\n"; + if (moduleClassMap.contains(node->name())) { + out() << "
  • Classes
  • \n"; } -#endif + out() << "
  • Detailed Description
  • \n"; + } + for (int i = 0; i < toc.size(); ++i) { Atom *atom = toc.at(i); @@ -2084,8 +2090,6 @@ void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker << "\">"; generateAtomList(headingText.firstAtom(), node, marker, true, numAtoms); out() << "\n"; - - ++columnSize; } while (!sectionNumber.isEmpty()) { out() << "
\n"; -- cgit v0.12