From 0f02d27038017a9040c635a8053826671bb10517 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 27 Apr 2010 14:55:11 +0200 Subject: qdoc: Added breadcrumbs for class pages. --- tools/qdoc3/htmlgenerator.cpp | 44 ++++++++++++++++++------------------------- tools/qdoc3/text.h | 2 +- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 01dc26c..8e3b38c 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1674,39 +1674,30 @@ QString HtmlGenerator::fileExtension(const Node * /* node */) const return "html"; } -#if 0 - - - - - Qt Reference Documentation - - - - - - - - - -#endif - void HtmlGenerator::generateBreadCrumbs(const QString& title, const Node *node, CodeMarker *marker) { + Text breadcrumb; if (node->type() == Node::Class) { + ClassNode* cn = static_cast(node); + QString name = node->moduleName(); + if (!name.isEmpty()) { + out() << "
  • "; + breadcrumb << Atom(Atom::AutoLink,name); + generateText(breadcrumb, node, marker); + out() << "
  • \n"; + } + breadcrumb.clear(); + if (!cn->name().isEmpty()) { + out() << "
  • "; + breadcrumb << Atom(Atom::AutoLink,cn->name()); + generateText(breadcrumb, 0, marker); + out() << "
  • \n"; + } } else if (node->type() == Node::Fake) { + const FakeNode* fn = static_cast(node); if (node->subType() == Node::Module) { } else if (node->subType() == Node::Page) { @@ -1717,6 +1708,7 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, } } else if (node->type() == Node::Namespace) { + const NamespaceNode* nsn = static_cast(node); } } diff --git a/tools/qdoc3/text.h b/tools/qdoc3/text.h index fa3ecda..879f6da 100644 --- a/tools/qdoc3/text.h +++ b/tools/qdoc3/text.h @@ -75,6 +75,7 @@ class Text const Atom *lastAtom() const { return last; } Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0) const; void dump() const; + void clear(); static Text subText(const Atom *begin, const Atom *end = 0); static Text sectionHeading(const Atom *sectionBegin); @@ -82,7 +83,6 @@ class Text static int compare(const Text &text1, const Text &text2); private: - void clear(); Atom *first; Atom *last; -- cgit v0.12