diff options
author | Martin Smith <msmith@trolltech.com> | 2010-04-27 12:55:11 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2010-04-27 12:55:11 (GMT) |
commit | 0f02d27038017a9040c635a8053826671bb10517 (patch) | |
tree | fde8fa88af94d4d48ad8d4523022e15d4113a724 /tools | |
parent | 9cea45515ef283c9a870c6f515da50d31addafcf (diff) | |
download | Qt-0f02d27038017a9040c635a8053826671bb10517.zip Qt-0f02d27038017a9040c635a8053826671bb10517.tar.gz Qt-0f02d27038017a9040c635a8053826671bb10517.tar.bz2 |
qdoc: Added breadcrumbs for class pages.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 44 | ||||
-rw-r--r-- | 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 -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>Qt Reference Documentation</title> - <link rel="stylesheet" type="text/css" href="style/style.css" /> - <!--[if IE]> - <meta name="MSSmartTagsPreventParsing" content="true"> - <meta http-equiv="imagetoolbar" content="no"> - <![endif]--> - <!--[if lt IE 7]> - <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> - <![endif]--> - <!--[if IE 7]> - <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> - <![endif]--> - <!--[if IE 8]> - <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> - <![endif]--> - - <script src="scripts/jquery.js" type="text/javascript"></script> - -</head> -#endif - void HtmlGenerator::generateBreadCrumbs(const QString& title, const Node *node, CodeMarker *marker) { + Text breadcrumb; if (node->type() == Node::Class) { + ClassNode* cn = static_cast<const ClassNode*>(node); + QString name = node->moduleName(); + if (!name.isEmpty()) { + out() << " <li>"; + breadcrumb << Atom(Atom::AutoLink,name); + generateText(breadcrumb, node, marker); + out() << "</li>\n"; + } + breadcrumb.clear(); + if (!cn->name().isEmpty()) { + out() << " <li>"; + breadcrumb << Atom(Atom::AutoLink,cn->name()); + generateText(breadcrumb, 0, marker); + out() << "</li>\n"; + } } else if (node->type() == Node::Fake) { + const FakeNode* fn = static_cast<const FakeNode*>(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<const NamespaceNode*>(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; |