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 | |
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')
-rw-r--r-- | tools/qdoc3/atom.cpp | 2 | ||||
-rw-r--r-- | tools/qdoc3/atom.h | 4 | ||||
-rw-r--r-- | tools/qdoc3/doc.cpp | 12 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 57 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 3 | ||||
-rw-r--r-- | tools/qdoc3/main.cpp | 1 |
6 files changed, 71 insertions, 8 deletions
diff --git a/tools/qdoc3/atom.cpp b/tools/qdoc3/atom.cpp index 69204d4..834a5d7 100644 --- a/tools/qdoc3/atom.cpp +++ b/tools/qdoc3/atom.cpp @@ -143,6 +143,7 @@ QString Atom::UPPERROMAN_ ("upperroman"); \value SectionHeadingRight \value SidebarLeft \value SidebarRight + \value SinceList \value String \value TableLeft \value TableRight @@ -220,6 +221,7 @@ static const struct { { "SectionHeadingRight", Atom::SectionHeadingRight }, { "SidebarLeft", Atom::SidebarLeft }, { "SidebarRight", Atom::SidebarRight }, + { "SinceList", Atom::SinceList }, { "SnippetCommand", Atom::SnippetCommand }, { "SnippetIdentifier", Atom::SnippetIdentifier }, { "SnippetLocation", Atom::SnippetLocation }, diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h index 95faa8f..99f9b57 100644 --- a/tools/qdoc3/atom.h +++ b/tools/qdoc3/atom.h @@ -112,7 +112,9 @@ class Atom SectionRight, SectionHeadingLeft, SectionHeadingRight, - SidebarLeft, SidebarRight, + SidebarLeft, + SidebarRight, + SinceList, SnippetCommand, SnippetIdentifier, SnippetLocation, diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index b918fa5..e27209c 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -90,10 +90,10 @@ enum { CMD_PRINTUNTIL, CMD_QUOTATION, CMD_QUOTEFILE, CMD_QUOTEFROMFILE, CMD_QUOTEFUNCTION, CMD_RAW, CMD_ROW, CMD_SA, CMD_SECTION1, CMD_SECTION2, CMD_SECTION3, - CMD_SECTION4, CMD_SIDEBAR, CMD_SKIPLINE, CMD_SKIPTO, - CMD_SKIPUNTIL, CMD_SNIPPET, CMD_SUB, CMD_SUP, CMD_TABLE, - CMD_TABLEOFCONTENTS, CMD_TARGET, CMD_TT, CMD_UNDERLINE, - CMD_UNICODE, CMD_VALUE, CMD_WARNING, + CMD_SECTION4, CMD_SIDEBAR, CMD_SINCELIST, CMD_SKIPLINE, + CMD_SKIPTO, CMD_SKIPUNTIL, CMD_SNIPPET, CMD_SUB, CMD_SUP, + CMD_TABLE, CMD_TABLEOFCONTENTS, CMD_TARGET, CMD_TT, + CMD_UNDERLINE, CMD_UNICODE, CMD_VALUE, CMD_WARNING, #ifdef QDOC_QML CMD_QML, CMD_ENDQML, CMD_CPP, CMD_ENDCPP, CMD_QMLTEXT, CMD_ENDQMLTEXT, CMD_CPPTEXT, CMD_ENDCPPTEXT, @@ -177,6 +177,7 @@ static struct { { "section3", CMD_SECTION3, 0 }, { "section4", CMD_SECTION4, 0 }, { "sidebar", CMD_SIDEBAR, 0 }, // ### don't document for now + { "sincelist", CMD_SINCELIST, 0 }, { "skipline", CMD_SKIPLINE, 0 }, { "skipto", CMD_SKIPTO, 0 }, { "skipuntil", CMD_SKIPUNTIL, 0 }, @@ -727,6 +728,9 @@ void DocParser::parse(const QString& source, case CMD_ANNOTATEDLIST: append(Atom::AnnotatedList, getArgument()); break; + case CMD_SINCELIST: + append(Atom::SinceList, getArgument()); + break; case CMD_GENERATELIST: append(Atom::GeneratedList, getArgument()); break; 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(); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index fabe585..24e2986 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -216,6 +216,7 @@ class HtmlGenerator : public PageGenerator #ifdef ZZZ_QDOC_QML void findAllQmlClasses(const InnerNode *node); #endif + void findAllSince(const InnerNode *node, QString version); static int hOffset(const Node *node); static bool isThreeColumnEnumValueTable(const Atom *atom); virtual QString getLink(const Atom *atom, @@ -285,6 +286,8 @@ class HtmlGenerator : public PageGenerator #endif QMap<QString, QMap<QString, const Node *> > funcIndex; QMap<Text, const Node *> legaleseTexts; + QMap<QString, Node*> sinceClasses; + QMap<QString, Node*> sinceFunctions; }; #define HTMLGENERATOR_ADDRESS "address" diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index aac4ee8..8658428 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -336,7 +336,6 @@ static void processQdocconfFile(const QString &fileName) /* Generate the XML tag file, if it was requested. */ - QString tagFile = config.getString(CONFIG_TAGFILE); if (!tagFile.isEmpty()) tree->generateTagFile(tagFile); |