diff options
author | Martin Smith <msmith@trolltech.com> | 2009-09-21 08:41:46 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2009-09-21 08:43:14 (GMT) |
commit | 42563fa22cfe7d6be252df69244c8196f498444d (patch) | |
tree | 13c2df2f6d4a52fabdbdeca36926b6c94e764f27 /tools/qdoc3/htmlgenerator.cpp | |
parent | 951915edc6f863724d83502e7486c73d25892d1d (diff) | |
download | Qt-42563fa22cfe7d6be252df69244c8196f498444d.zip Qt-42563fa22cfe7d6be252df69244c8196f498444d.tar.gz Qt-42563fa22cfe7d6be252df69244c8196f498444d.tar.bz2 |
qdoc: Added "since" 4.6 lists to the "What's New" page.
In test/qt.qdocconf, change %VERSION% to 4.6, for example.
Diffstat (limited to 'tools/qdoc3/htmlgenerator.cpp')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index b7ed702..6a8c098 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -330,6 +330,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) #ifdef ZZZ_QDOC_QML findAllQmlClasses(tree->root()); #endif + findAllSince(tree->root(),tree->version()); PageGenerator::generateTree(tree, marker); @@ -539,7 +540,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; case Atom::AnnotatedList: { - //qDebug() << "ANNOTATED LIS:"; QList<Node*> values = tre->groups().values(atom->string()); QMap<QString, const Node*> nodeMap; for (int i = 0; i < values.size(); ++i) { @@ -653,7 +653,26 @@ int HtmlGenerator::generateAtom(const Atom *atom, } } break; - case Atom::Image: + case Atom::SinceList: + { + QList<Node*> values; + if (atom->string() == "classes") { + values = sinceClasses.values(); + } + else if (atom->string() == "functions") { + values = sinceFunctions.values(); + } + if (!values.isEmpty()) { + QMap<QString, const Node*> nodeMap; + for (int i=0; i<values.size(); ++i) { + const Node* n = values.at(i); + nodeMap.insert(n->nameForLists(),n); + } + generateAnnotatedList(relative, marker, nodeMap); + } + } + break; +case Atom::Image: case Atom::InlineImage: { QString fileName = imageFileName(relative, atom->string()); @@ -3495,6 +3514,40 @@ void HtmlGenerator::findAllClasses(const InnerNode *node) } } +/*! + For generating the "Since x.y" page. + */ +void HtmlGenerator::findAllSince(const InnerNode *node, QString version) +{ + NodeList::const_iterator c = node->childNodes().constBegin(); + while (c != node->childNodes().constEnd()) { + if (((*c)->access() != Node::Private) && ((*c)->since() == version)) { + if ((*c)->type() == Node::Function) { + FunctionNode *func = static_cast<const FunctionNode *>(*c); + if ((func->status() > Node::Obsolete) && + (func->metaness() != FunctionNode::Ctor) && + (func->metaness() != FunctionNode::Dtor)) { + sinceFunctions.insert(func->name(), func); + } + } + else if ((*c)->url().isEmpty()) { + if ((*c)->type() == Node::Class && !(*c)->doc().isEmpty()) { + QString className = (*c)->name(); + if ((*c)->parent() && + (*c)->parent()->type() == Node::Namespace && + !(*c)->parent()->name().isEmpty()) + className = (*c)->parent()->name()+"::"+className; + sinceClasses.insert(className, *c); + } + } + if ((*c)->isInnerNode()) { + findAllSince(static_cast<InnerNode *>(*c),version); + } + } + ++c; + } +} + void HtmlGenerator::findAllFunctions(const InnerNode *node) { NodeList::ConstIterator c = node->childNodes().begin(); |