summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/generator.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-09-18 11:37:32 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-09-18 11:37:32 (GMT)
commited73f806928760ace1d4c7c2a6327875725bcb05 (patch)
treefe980a1a26aa231212f35810f5be680f3e9fa17b /tools/qdoc3/generator.cpp
parent4b8542e958ebced0b324e64291c6d10d79680021 (diff)
downloadQt-ed73f806928760ace1d4c7c2a6327875725bcb05.zip
Qt-ed73f806928760ace1d4c7c2a6327875725bcb05.tar.gz
Qt-ed73f806928760ace1d4c7c2a6327875725bcb05.tar.bz2
qdoc: DITA XML generator now uses <section> elements...
...instead of <p> elements with the outputclass attribute set to some h value. Also added some missing macros to qt-ditaxml.qdocconf, but there is more to think about here.
Diffstat (limited to 'tools/qdoc3/generator.cpp')
-rw-r--r--tools/qdoc3/generator.cpp72
1 files changed, 26 insertions, 46 deletions
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index 5bd5156..1a41399 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -327,6 +327,7 @@ bool Generator::generateText(const Text& text,
const Node *relative,
CodeMarker *marker)
{
+ bool result = false;
if (text.firstAtom() != 0) {
int numAtoms = 0;
startText(relative, marker);
@@ -336,9 +337,9 @@ bool Generator::generateText(const Text& text,
true,
numAtoms);
endText(relative, marker);
- return true;
+ result = true;
}
- return false;
+ return result;
}
#ifdef QDOC_QML
@@ -352,24 +353,26 @@ bool Generator::generateQmlText(const Text& text,
const QString& /* qmlName */ )
{
const Atom* atom = text.firstAtom();
- if (atom == 0)
- return false;
+ bool result = false;
- startText(relative, marker);
- while (atom) {
- if (atom->type() != Atom::QmlText)
- atom = atom->next();
- else {
- atom = atom->next();
- while (atom && (atom->type() != Atom::EndQmlText)) {
- int n = 1 + generateAtom(atom, relative, marker);
- while (n-- > 0)
- atom = atom->next();
+ if (atom != 0) {
+ startText(relative, marker);
+ while (atom) {
+ if (atom->type() != Atom::QmlText)
+ atom = atom->next();
+ else {
+ atom = atom->next();
+ while (atom && (atom->type() != Atom::EndQmlText)) {
+ int n = 1 + generateAtom(atom, relative, marker);
+ while (n-- > 0)
+ atom = atom->next();
+ }
}
}
+ endText(relative, marker);
+ result = true;
}
- endText(relative, marker);
- return true;
+ return result;
}
#endif
@@ -377,14 +380,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
{
bool quiet = false;
- if (node->type() == Node::Function) {
-#if 0
- const FunctionNode *func = (const FunctionNode *) node;
- if (func->isOverload() && func->metaness() != FunctionNode::Ctor)
- generateOverload(node, marker);
-#endif
- }
- else if (node->type() == Node::Fake) {
+ if (node->type() == Node::Fake) {
const FakeNode *fake = static_cast<const FakeNode *>(node);
if (fake->subType() == Node::Example) {
generateExampleFiles(fake, marker);
@@ -501,18 +497,16 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
++a;
}
}
-/* Something like this return value check should be implemented at some point. */
+ /*
+ Something like this return value check should
+ be implemented at some point.
+ */
if (func->status() > Node::Obsolete && func->returnType() == "bool"
&& func->reimplementedFrom() == 0 && !func->isOverload()) {
QString body = func->doc().body().toString();
if (!body.contains("return", Qt::CaseInsensitive))
node->doc().location().warning(tr("Undocumented return value"));
}
-#if 0
- // Now we put this at the top, before the other text.
- if (func->reimplementedFrom() != 0)
- generateReimplementedFrom(func, marker);
-#endif
}
}
@@ -1091,20 +1085,6 @@ void Generator::generateSince(const Node *node, CodeMarker *marker)
}
}
-/*!
- No longer in use.
- */
-void Generator::generateOverload(const Node *node, CodeMarker *marker)
-{
- Text text;
- text << Atom::ParaLeft
- << "This function overloads ";
- QString t = node->name() + "()";
- text << Atom::AutoLink << t
- << Atom::ParaRight;
- generateText(text, node, marker);
-}
-
void Generator::generateReimplementedFrom(const FunctionNode *func,
CodeMarker *marker)
{
@@ -1153,8 +1133,8 @@ const Atom *Generator::generateAtomList(const Atom *atom,
if (atom->type() == Atom::FormatEndif) {
if (generate && numAtoms0 == numAtoms) {
- relative->location().warning(tr("Output format %1 not handled")
- .arg(format()));
+ relative->location().warning(tr("Output format %1 not handled %2")
+ .arg(format()).arg(outFileName()));
Atom unhandledFormatAtom(Atom::UnhandledFormat, format());
generateAtomList(&unhandledFormatAtom,
relative,