summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2010-02-11 10:31:36 (GMT)
committerMartin Smith <msmith@trolltech.com>2010-02-11 10:31:36 (GMT)
commit802051dd1eb8dd63e84ac0c241f560d8cdf350c5 (patch)
tree32b681c0925298598ba2e0bb56e3d1b09f2f8eea /tools/qdoc3
parent9a83bf2676dabdf36f9ca491b480b50d8e7ed93d (diff)
downloadQt-802051dd1eb8dd63e84ac0c241f560d8cdf350c5.zip
Qt-802051dd1eb8dd63e84ac0c241f560d8cdf350c5.tar.gz
Qt-802051dd1eb8dd63e84ac0c241f560d8cdf350c5.tar.bz2
qdoc3: Added curly braces in switch statement for braindead compiler.
Also added the \pagekeywords command. Task: QTBUG-7877
Diffstat (limited to 'tools/qdoc3')
-rw-r--r--tools/qdoc3/codeparser.cpp5
-rw-r--r--tools/qdoc3/htmlgenerator.cpp26
-rw-r--r--tools/qdoc3/node.cpp2
-rw-r--r--tools/qdoc3/node.h4
4 files changed, 26 insertions, 11 deletions
diff --git a/tools/qdoc3/codeparser.cpp b/tools/qdoc3/codeparser.cpp
index 3ad3372..5ae63ac 100644
--- a/tools/qdoc3/codeparser.cpp
+++ b/tools/qdoc3/codeparser.cpp
@@ -59,6 +59,7 @@ QT_BEGIN_NAMESPACE
#define COMMAND_MAINCLASS Doc::alias(QLatin1String("mainclass"))
#define COMMAND_NONREENTRANT Doc::alias(QLatin1String("nonreentrant"))
#define COMMAND_OBSOLETE Doc::alias(QLatin1String("obsolete"))
+#define COMMAND_PAGEKEYWORDS Doc::alias(QLatin1String("pagekeywords"))
#define COMMAND_PRELIMINARY Doc::alias(QLatin1String("preliminary"))
#define COMMAND_INPUBLICGROUP Doc::alias(QLatin1String("inpublicgroup"))
#define COMMAND_REENTRANT Doc::alias(QLatin1String("reentrant"))
@@ -170,6 +171,7 @@ QSet<QString> CodeParser::commonMetaCommands()
<< COMMAND_MAINCLASS
<< COMMAND_NONREENTRANT
<< COMMAND_OBSOLETE
+ << COMMAND_PAGEKEYWORDS
<< COMMAND_PRELIMINARY
<< COMMAND_INPUBLICGROUP
<< COMMAND_REENTRANT
@@ -230,6 +232,9 @@ void CodeParser::processCommonMetaCommand(const Location &location,
else if (command == COMMAND_SINCE) {
node->setSince(arg);
}
+ else if (command == COMMAND_PAGEKEYWORDS) {
+ node->addPageKeywords(arg);
+ }
else if (command == COMMAND_SUBTITLE) {
if (node->type() == Node::Fake) {
FakeNode *fake = static_cast<FakeNode *>(node);
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 27716a4..ffd3b5b 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -4378,18 +4378,24 @@ bool HtmlGenerator::generatePageElement(QXmlStreamWriter& writer,
t.setNum(id++);
switch (node->type()) {
case Node::Fake:
- const FakeNode* fake = static_cast<const FakeNode*>(node);
- title = fake->fullTitle();
- break;
+ {
+ const FakeNode* fake = static_cast<const FakeNode*>(node);
+ title = fake->fullTitle();
+ break;
+ }
case Node::Class:
- title = node->name() + " Class Reference";
- break;
+ {
+ title = node->name() + " Class Reference";
+ break;
+ }
case Node::Namespace:
- const InnerNode* inner = static_cast<const InnerNode*>(node);
- rawTitle = marker->plainName(inner);
- fullTitle = marker->plainFullName(inner);
- title = rawTitle + " Namespace Reference";
- break;
+ {
+ const InnerNode* inner = static_cast<const InnerNode*>(node);
+ rawTitle = marker->plainName(inner);
+ fullTitle = marker->plainFullName(inner);
+ title = rawTitle + " Namespace Reference";
+ break;
+ }
default:
title = node->name();
break;
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index f3958c6..ec574f8 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -415,7 +415,7 @@ void InnerNode::deleteChildren()
}
/*!
- Returns true.
+ Returns true because this is an inner node.
*/
bool InnerNode::isInnerNode() const
{
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index 679a9d4..6a540d4 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -183,6 +183,7 @@ class Node
QString since() const { return sinc; }
QString templateStuff() const { return tpl; }
PageType pageType() const { return pageTyp; }
+ virtual void addPageKeywords(const QString& ) { }
void clearRelated() { rel = 0; }
@@ -256,6 +257,8 @@ class InnerNode : public Node
QStringList primaryKeys();
QStringList secondaryKeys();
+ QStringList pageKeywords() { return pageKeywds; }
+ virtual void addPageKeywords(const QString& t) { pageKeywds << t; }
protected:
InnerNode(Type type, InnerNode *parent, const QString& name);
@@ -268,6 +271,7 @@ class InnerNode : public Node
void removeChild(Node *child);
void removeRelated(Node *pseudoChild);
+ QStringList pageKeywds;
QStringList inc;
NodeList children;
NodeList enumChildren;