From 153fa2771662810557b775d07453fd3d1064ed66 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 11 May 2011 14:51:56 +0200 Subject: doc: Fixed QTBUG-18791 --- tools/qdoc3/atom.cpp | 6 +- tools/qdoc3/atom.h | 26 ++--- tools/qdoc3/config.cpp | 2 +- tools/qdoc3/ditaxmlgenerator.cpp | 33 +++++- tools/qdoc3/ditaxmlgenerator.h | 2 +- tools/qdoc3/doc.cpp | 246 ++++++++++++++++++++++----------------- tools/qdoc3/doc.h | 18 +-- tools/qdoc3/htmlgenerator.cpp | 3 +- tools/qdoc3/qdoc3.pro | 2 +- 9 files changed, 193 insertions(+), 145 deletions(-) diff --git a/tools/qdoc3/atom.cpp b/tools/qdoc3/atom.cpp index 2d50e5a..f2a5af9 100644 --- a/tools/qdoc3/atom.cpp +++ b/tools/qdoc3/atom.cpp @@ -184,9 +184,7 @@ static const struct { { "CodeQuoteCommand", Atom::CodeQuoteCommand }, { "DivLeft", Atom::DivLeft }, { "DivRight", Atom::DivRight }, -#ifdef QDOC_QML { "EndQmlText", Atom::EndQmlText }, -#endif { "FootnoteLeft", Atom::FootnoteLeft }, { "FootnoteRight", Atom::FootnoteRight }, { "FormatElse", Atom::FormatElse }, @@ -199,6 +197,8 @@ static const struct { { "Image", Atom::Image }, { "ImageText", Atom::ImageText }, { "InlineImage", Atom::InlineImage }, + { "JavaScript", Atom::JavaScript }, + { "EndJavaScript", Atom::EndJavaScript }, { "LegaleseLeft", Atom::LegaleseLeft }, { "LegaleseRight", Atom::LegaleseRight }, { "LineBreak", Atom::LineBreak }, @@ -214,10 +214,8 @@ static const struct { { "Nop", Atom::Nop }, { "ParaLeft", Atom::ParaLeft }, { "ParaRight", Atom::ParaRight }, -#ifdef QDOC_QML { "Qml", Atom::Qml}, { "QmlText", Atom::QmlText }, -#endif { "QuotationLeft", Atom::QuotationLeft }, { "QuotationRight", Atom::QuotationRight }, { "RawString", Atom::RawString }, diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h index dbb1a8b..f7d1950 100644 --- a/tools/qdoc3/atom.h +++ b/tools/qdoc3/atom.h @@ -56,7 +56,7 @@ class Atom { public: enum Type { - AbstractLeft, // 00 + AbstractLeft, AbstractRight, AnnotatedList, AutoLink, @@ -66,19 +66,17 @@ class Atom C, CaptionLeft, CaptionRight, - Code, // 10 + Code, CodeBad, CodeNew, CodeOld, CodeQuoteArgument, CodeQuoteCommand, - DivLeft, // 16 - DivRight, // 17 -#ifdef QDOC_QML + DivLeft, + DivRight, EndQmlText, -#endif FootnoteLeft, - FootnoteRight, // 20 + FootnoteRight, FormatElse, FormatEndif, FormatIf, @@ -88,11 +86,9 @@ class Atom GuidLink, Image, ImageText, - InlineImage, // 30 -#ifdef QDOC_QML + InlineImage, JavaScript, EndJavaScript, -#endif LegaleseLeft, LegaleseRight, LineBreak, @@ -100,7 +96,7 @@ class Atom LinkNode, ListLeft, ListItemNumber, - ListTagLeft, // 40 + ListTagLeft, ListTagRight, ListItemLeft, ListItemRight, @@ -108,11 +104,9 @@ class Atom Nop, ParaLeft, ParaRight, -#ifdef QDOC_QML Qml, QmlText, -#endif - QuotationLeft, // 50 + QuotationLeft, QuotationRight, RawString, SectionLeft, @@ -122,7 +116,7 @@ class Atom SidebarLeft, SidebarRight, SinceList, - SnippetCommand, // 60 + SnippetCommand, SnippetIdentifier, SnippetLocation, String, @@ -132,7 +126,7 @@ class Atom TableHeaderRight, TableRowLeft, TableRowRight, - TableItemLeft, // 70 + TableItemLeft, TableItemRight, TableOfContents, Target, diff --git a/tools/qdoc3/config.cpp b/tools/qdoc3/config.cpp index 06931ec..1ff2a0d 100644 --- a/tools/qdoc3/config.cpp +++ b/tools/qdoc3/config.cpp @@ -696,7 +696,7 @@ void Config::load(Location location, const QString& fileName) } while (isMetaKeyChar(c)); QStringList keys = stack.getExpanded(location); - qDebug() << "KEYS:" << keys; + //qDebug() << "KEYS:" << keys; SKIP_SPACES(); if (keys.count() == 1 && keys.first() == "include") { diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 5f44cd8..68b66b3 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -62,6 +62,8 @@ QT_BEGIN_NAMESPACE #define COMMAND_VERSION Doc::alias("version") int DitaXmlGenerator::id = 0; +static int debug = 0; + QString DitaXmlGenerator::sinceTitles[] = { " New Namespaces", @@ -1456,10 +1458,14 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, inApiDesc = false; } #endif + if (debug == 1) + qDebug() << "SectionLeft"; enterSection("details",QString()); //writeGuidAttribute(Doc::canonicalTitle(Text::sectionHeading(atom).toString())); break; case Atom::SectionRight: + if (debug == 1) + qDebug() << "SectionRight"; leaveSection(); break; case Atom::SectionHeadingLeft: @@ -1637,7 +1643,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, int numColumns = 1; const Node* node = relative; - Doc::SectioningUnit sectioningUnit = Doc::Section4; + Doc::Sections sectionUnit = Doc::Section4; QStringList params = atom->string().split(","); QString columnText = params.at(0); QStringList pieces = columnText.split(" ", QString::SkipEmptyParts); @@ -1650,13 +1656,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (params.size() == 2) { numColumns = qMax(columnText.toInt(), numColumns); - sectioningUnit = (Doc::SectioningUnit)params.at(1).toInt(); + sectionUnit = (Doc::Sections)params.at(1).toInt(); } if (node) generateTableOfContents(node, marker, - sectioningUnit, + sectionUnit, numColumns, relative); } @@ -1743,6 +1749,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark enterSection("h2","Detailed Description"); generateBody(nsn, marker); + generateAlsoList(nsn, marker); leaveSection(); leaveSection(); // @@ -1877,6 +1884,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateSince(cn, marker); enterSection("h2","Detailed Description"); generateBody(cn, marker); + generateAlsoList(cn, marker); leaveSection(); leaveSection(); // @@ -1995,6 +2003,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateSince(fn, marker); enterSection("h2","Detailed Description"); generateBody(fn, marker); + generateAlsoList(fn, marker); leaveSection(); leaveSection(); // @@ -2115,6 +2124,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateBody(qcn, marker); if (cn) generateQmlText(cn->doc().body(), cn, marker, qcn->name()); + generateAlsoList(cn, marker); leaveSection(); leaveSection(); // @@ -2458,7 +2468,7 @@ void DitaXmlGenerator::generateIncludes(const InnerNode* inner, CodeMarker* mark */ void DitaXmlGenerator::generateTableOfContents(const Node* node, CodeMarker* marker, - Doc::SectioningUnit sectioningUnit, + Doc::Sections sectionUnit, int numColumns, const Node* relative) @@ -2492,7 +2502,7 @@ void DitaXmlGenerator::generateTableOfContents(const Node* node, Atom *atom = toc.at(i); int nextLevel = atom->string().toInt(); - if (nextLevel > (int)sectioningUnit) + if (nextLevel > (int)sectionUnit) continue; if (sectionNumber.size() < nextLevel) { @@ -5481,7 +5491,20 @@ void DitaXmlGenerator::writeApiDesc(const Node* node, if (!node->doc().isEmpty()) { inDetailedDescription = true; enterApiDesc(QString(),title); + if ((outFileName() == "qelapsedtimer.xml") && (debug == 0)) { + qDebug() << "SECTION NESTING LEVEL 1:" << sectionNestingLevel; + debug = 1; + const Text& t = node->doc().body(); + t.dump(); + } generateBody(node, marker); + if ((outFileName() == "qelapsedtimer.xml") && (debug == 1)) + qDebug() << "SECTION NESTING LEVEL 2:" << sectionNestingLevel; + generateAlsoList(node, marker); + if ((outFileName() == "qelapsedtimer.xml") && (debug == 1)) { + qDebug() << "SECTION NESTING LEVEL 3:" << sectionNestingLevel; + debug = 2; + } leaveSection(); } inDetailedDescription = false; diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 0044eff..7d73653 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -343,7 +343,7 @@ class DitaXmlGenerator : public PageGenerator void generateIncludes(const InnerNode* inner, CodeMarker* marker); void generateTableOfContents(const Node* node, CodeMarker* marker, - Doc::SectioningUnit sectioningUnit, + Doc::Sections sectioningUnit, int numColumns, const Node* relative = 0); void generateTableOfContents(const Node* node, diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 2239f43..a7d331e 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -74,32 +74,105 @@ struct Macro }; enum { - CMD_A, CMD_ABSTRACT, CMD_ANNOTATEDLIST, CMD_BADCODE, - CMD_BASENAME, CMD_BOLD, CMD_BRIEF, CMD_C, CMD_CAPTION, - CMD_CHAPTER, CMD_CODE, CMD_CODELINE, CMD_DIV, CMD_DOTS, - CMD_ELSE, CMD_ENDABSTRACT, CMD_ENDCHAPTER, CMD_ENDCODE, - CMD_ENDDIV, CMD_ENDFOOTNOTE, CMD_ENDIF, CMD_ENDLEGALESE, - CMD_ENDLINK, CMD_ENDLIST, CMD_ENDOMIT, CMD_ENDPART, - CMD_ENDQUOTATION, CMD_ENDRAW, CMD_ENDSECTION1, CMD_ENDSECTION2, - CMD_ENDSECTION3, CMD_ENDSECTION4, CMD_ENDSIDEBAR, - CMD_ENDTABLE, CMD_EXPIRE, CMD_FOOTNOTE, CMD_GENERATELIST, - CMD_GRANULARITY, CMD_HEADER, CMD_I, CMD_IF, CMD_IMAGE, - CMD_INCLUDE, CMD_INLINEIMAGE, CMD_INDEX, CMD_KEYWORD, - CMD_L, CMD_LEGALESE, CMD_LINK, CMD_LIST, CMD_META, - CMD_NEWCODE, CMD_O, CMD_OLDCODE, CMD_OMIT, CMD_OMITVALUE, - CMD_OVERLOAD, CMD_PART, CMD_PRINTLINE, CMD_PRINTTO, - 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_SINCELIST, CMD_SKIPLINE, - CMD_SKIPTO, CMD_SKIPUNTIL, CMD_SNIPPET, CMD_SPAN, 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, - CMD_JS, CMD_ENDJS, -#endif + CMD_A, + CMD_ABSTRACT, + CMD_ANNOTATEDLIST, + CMD_BADCODE, + CMD_BASENAME, + CMD_BOLD, + CMD_BRIEF, + CMD_C, + CMD_CAPTION, + CMD_CHAPTER, // 9 + CMD_CODE, + CMD_CODELINE, + CMD_DIV, + CMD_DOTS, + CMD_ELSE, + CMD_ENDABSTRACT, + CMD_ENDCHAPTER, + CMD_ENDCODE, + CMD_ENDDIV, + CMD_ENDFOOTNOTE, + CMD_ENDIF, + CMD_ENDLEGALESE, + CMD_ENDLINK, + CMD_ENDLIST, + CMD_ENDOMIT, + CMD_ENDPART, + CMD_ENDQUOTATION, + CMD_ENDRAW, + CMD_ENDSECTION1, + CMD_ENDSECTION2, + CMD_ENDSECTION3, + CMD_ENDSECTION4, + CMD_ENDSIDEBAR, + CMD_ENDTABLE, + CMD_EXPIRE, + CMD_FOOTNOTE, + CMD_GENERATELIST, + CMD_GRANULARITY, + CMD_HEADER, + CMD_I, + CMD_IF, + CMD_IMAGE, + CMD_INCLUDE, + CMD_INLINEIMAGE, + CMD_INDEX, + CMD_KEYWORD, + CMD_L, + CMD_LEGALESE, + CMD_LINK, + CMD_LIST, + CMD_META, + CMD_NEWCODE, + CMD_O, + CMD_OLDCODE, + CMD_OMIT, + CMD_OMITVALUE, + CMD_OVERLOAD, + CMD_PART, + CMD_PRINTLINE, + CMD_PRINTTO, + CMD_PRINTUNTIL, + CMD_QUOTATION, + CMD_QUOTEFILE, + CMD_QUOTEFROMFILE, + CMD_QUOTEFUNCTION, + CMD_RAW, + CMD_ROW, + CMD_SA, + CMD_SECTION1, // 68 + CMD_SECTION2, // 69 + CMD_SECTION3, // 70 + CMD_SECTION4, // 71 + CMD_SIDEBAR, + CMD_SINCELIST, + CMD_SKIPLINE, + CMD_SKIPTO, + CMD_SKIPUNTIL, + CMD_SNIPPET, + CMD_SPAN, + CMD_SUB, + CMD_SUP, + CMD_TABLE, + CMD_TABLEOFCONTENTS, + CMD_TARGET, + CMD_TT, + CMD_UNDERLINE, + CMD_UNICODE, + CMD_VALUE, + CMD_WARNING, + CMD_QML, + CMD_ENDQML, + CMD_CPP, + CMD_ENDCPP, + CMD_QMLTEXT, + CMD_ENDQMLTEXT, + CMD_CPPTEXT, + CMD_ENDCPPTEXT, + CMD_JS, + CMD_ENDJS, NOT_A_CMD }; @@ -197,7 +270,6 @@ static struct { { "unicode", CMD_UNICODE, 0 }, { "value", CMD_VALUE, 0 }, { "warning", CMD_WARNING, 0 }, -#ifdef QDOC_QML { "qml", CMD_QML, 0 }, { "endqml", CMD_ENDQML, 0 }, { "cpp", CMD_CPP, 0 }, @@ -208,7 +280,6 @@ static struct { { "endcpptext", CMD_ENDCPPTEXT, 0 }, { "js", CMD_JS, 0 }, { "endjs", CMD_ENDJS, 0 }, -#endif { 0, 0, 0 } }; @@ -223,13 +294,13 @@ class DocPrivateExtra { public: QString baseName; - Doc::SectioningUnit granularity; - Doc::SectioningUnit sectioningUnit; // ### + Doc::Sections granularity; + Doc::Sections section; // ### QList tableOfContents; QList tableOfContentsLevels; QList keywords; QList targets; - QStringMultiMap metaMap; + QStringMultiMap metaMap; DocPrivateExtra() : granularity(Doc::Part) { } @@ -365,7 +436,7 @@ class DocParser void startFormat(const QString& format, int cmd); bool openCommand(int cmd); bool closeCommand(int endCmd); - void startSection(Doc::SectioningUnit unit, int cmd); + void startSection(Doc::Sections unit, int cmd); void endSection(int unit, int endCmd); void parseAlso(); void append(Atom::Type type, const QString& string = ""); @@ -385,7 +456,7 @@ class DocParser CodeMarker *quoteFromFile(); void expandMacro(const QString& name, const QString& def, int numParams); QString expandMacroToString(const QString &name, const QString &def, int numParams); - Doc::SectioningUnit getSectioningUnit(); + Doc::Sections getSectioningUnit(); QString getArgument(bool verbatim = false); QString getOptionalArgument(); QString getRestOfLine(); @@ -426,7 +497,7 @@ class DocParser int braceDepth; int minIndent; - Doc::SectioningUnit currentSectioningUnit; + Doc::Sections currentSection; QMap targetMap; QMap pendingFormats; QStack openedCommands; @@ -472,7 +543,7 @@ void DocParser::parse(const QString& source, braceDepth = 0; minIndent = INT_MAX; - currentSectioningUnit = Doc::Book; + currentSection = Doc::NoSection; openedCommands.push(CMD_OMIT); quoter.reset(); @@ -561,7 +632,6 @@ void DocParser::parse(const QString& source, leavePara(); append(Atom::Code, getCode(CMD_CODE, 0)); break; -#ifdef QDOC_QML case CMD_QML: leavePara(); append(Atom::Qml, getCode(CMD_QML, CodeMarker::markerForLanguage(QLatin1String("QML")))); @@ -573,7 +643,6 @@ void DocParser::parse(const QString& source, leavePara(); append(Atom::JavaScript, getCode(CMD_JS, CodeMarker::markerForLanguage(QLatin1String("JavaScript")))); break; -#endif case CMD_DIV: leavePara(); p1 = getArgument(true); @@ -652,7 +721,6 @@ void DocParser::parse(const QString& source, case CMD_ENDCODE: closeCommand(cmd); break; -#ifdef QDOC_QML case CMD_ENDQML: closeCommand(cmd); break; @@ -662,7 +730,6 @@ void DocParser::parse(const QString& source, case CMD_ENDJS: closeCommand(cmd); break; -#endif case CMD_ENDFOOTNOTE: if (closeCommand(cmd)) { leavePara(); @@ -712,7 +779,7 @@ void DocParser::parse(const QString& source, closeCommand(cmd); break; case CMD_ENDPART: - endSection(-1, cmd); + endSection(Doc::Part, cmd); break; case CMD_ENDQUOTATION: if (closeCommand(cmd)) { @@ -724,16 +791,16 @@ void DocParser::parse(const QString& source, location().warning(tr("Unexpected '\\%1'").arg(cmdName(CMD_ENDRAW))); break; case CMD_ENDSECTION1: - endSection(1, cmd); + endSection(Doc::Section1, cmd); break; case CMD_ENDSECTION2: - endSection(2, cmd); + endSection(Doc::Section2, cmd); break; case CMD_ENDSECTION3: - endSection(3, cmd); + endSection(Doc::Section3, cmd); break; case CMD_ENDSECTION4: - endSection(4, cmd); + endSection(Doc::Section4, cmd); break; case CMD_ENDSIDEBAR: if (closeCommand(cmd)) { @@ -1463,14 +1530,13 @@ void DocParser::parse(const QString& source, location().warning(tr("Missing '\\%1'").arg(cmdName(CMD_ENDIF))); } - while (currentSectioningUnit >= Doc::Chapter) { - int delta = currentSectioningUnit - priv->extra->sectioningUnit; - append(Atom::SectionRight, QString::number(delta)); - currentSectioningUnit = Doc::SectioningUnit(int(currentSectioningUnit) - 1); + if (currentSection > Doc::NoSection) { + append(Atom::SectionRight, QString::number(currentSection)); + currentSection = Doc::NoSection; } - if (priv->extra && priv->extra->granularity < priv->extra->sectioningUnit) - priv->extra->granularity = priv->extra->sectioningUnit; + if (priv->extra && priv->extra->granularity < priv->extra->section) + priv->extra->granularity = priv->extra->section; priv->text.stripFirstAtom(); } @@ -1546,14 +1612,14 @@ void DocParser::checkExpiry(const QString& date) void DocParser::insertBaseName(const QString &baseName) { priv->constructExtra(); - if (currentSectioningUnit == priv->extra->sectioningUnit) { + if (currentSection == priv->extra->section) { priv->extra->baseName = baseName; } else { Atom *atom = priv->text.firstAtom(); Atom *sectionLeft = 0; - int delta = currentSectioningUnit - priv->extra->sectioningUnit; + int delta = currentSection - priv->extra->section; while (atom != 0) { if (atom->type() == Atom::SectionLeft && @@ -1772,60 +1838,34 @@ bool DocParser::closeCommand(int endCmd) } } -void DocParser::startSection(Doc::SectioningUnit unit, int cmd) +void DocParser::startSection(Doc::Sections unit, int cmd) { leaveValueList(); - if (currentSectioningUnit == Doc::Book) { - currentSectioningUnit = (Doc::SectioningUnit) (unit - 1); + if (currentSection == Doc::NoSection) { + currentSection = (Doc::Sections) (unit); priv->constructExtra(); - priv->extra->sectioningUnit = currentSectioningUnit; + priv->extra->section = currentSection; } + else + endSection(unit,cmd); - if (unit <= priv->extra->sectioningUnit) { - location().warning(tr("Unexpected '\\%1' in this documentation") - .arg(cmdName(cmd))); - } - else if (unit - currentSectioningUnit > 1) { - location().warning(tr("Unexpected '\\%1' at this point") - .arg(cmdName(cmd))); - } - else { - if (currentSectioningUnit >= unit) - endSection(unit, cmd); + append(Atom::SectionLeft, QString::number(unit)); + priv->constructExtra(); + priv->extra->tableOfContents.append(priv->text.lastAtom()); + priv->extra->tableOfContentsLevels.append(unit); + enterPara(Atom::SectionHeadingLeft, + Atom::SectionHeadingRight, + QString::number(unit)); + currentSection = unit; - int delta = unit - priv->extra->sectioningUnit; - append(Atom::SectionLeft, QString::number(delta)); - priv->constructExtra(); - priv->extra->tableOfContents.append(priv->text.lastAtom()); - priv->extra->tableOfContentsLevels.append(unit); - enterPara(Atom::SectionHeadingLeft, - Atom::SectionHeadingRight, - QString::number(delta)); - currentSectioningUnit = unit; - } } void DocParser::endSection(int unit, int endCmd) { leavePara(); - - if (unit < priv->extra->sectioningUnit) { - location().warning(tr("Unexpected '\\%1' in this documentation") - .arg(cmdName(endCmd))); - } - else if (unit > currentSectioningUnit) { - location().warning(tr("Unexpected '\\%1' at this point") - .arg(cmdName(endCmd))); - } - else { - while (currentSectioningUnit >= unit) { - int delta = currentSectioningUnit - priv->extra->sectioningUnit; - append(Atom::SectionRight, QString::number(delta)); - currentSectioningUnit = - (Doc::SectioningUnit) (currentSectioningUnit - 1); - } - } + append(Atom::SectionRight, QString::number(currentSection)); + currentSection = (Doc::NoSection); } void DocParser::parseAlso() @@ -2141,7 +2181,7 @@ QString DocParser::expandMacroToString(const QString &name, const QString &def, } } -Doc::SectioningUnit DocParser::getSectioningUnit() +Doc::Sections DocParser::getSectioningUnit() { QString name = getOptionalArgument(); @@ -2164,11 +2204,11 @@ Doc::SectioningUnit DocParser::getSectioningUnit() return Doc::Section4; } else if (name.isEmpty()) { - return Doc::Section4; + return Doc::NoSection; } else { - location().warning(tr("Invalid sectioning unit '%1'").arg(name)); - return Doc::Book; + location().warning(tr("Invalid section '%1'").arg(name)); + return Doc::NoSection; } } @@ -2508,14 +2548,12 @@ int DocParser::endCmdFor(int cmd) return CMD_ENDCODE; case CMD_DIV: return CMD_ENDDIV; -#ifdef QDOC_QML case CMD_QML: return CMD_ENDQML; case CMD_QMLTEXT: return CMD_ENDQMLTEXT; case CMD_JS: return CMD_ENDJS; -#endif case CMD_FOOTNOTE: return CMD_ENDFOOTNOTE; case CMD_LEGALESE: @@ -2645,11 +2683,7 @@ QString DocParser::slashed(const QString& str) } #define COMMAND_BRIEF Doc::alias("brief") - -#ifdef QDOC_QML #define COMMAND_QMLBRIEF Doc::alias("qmlbrief") -#endif - Doc::Doc(const Location& start_loc, const Location& end_loc, @@ -2882,7 +2916,7 @@ const QString& Doc::baseName() const } } -Doc::SectioningUnit Doc::granularity() const +Doc::Sections Doc::granularity() const { if (priv == 0 || priv->extra == 0) { return DocPrivateExtra().granularity; @@ -2975,9 +3009,7 @@ void Doc::initialize(const Config& config) DocParser::sourceDirs = config.getStringList(CONFIG_SOURCEDIRS); DocParser::quoting = config.getBool(CONFIG_QUOTINGINFORMATION); -#ifdef QDOC_QML QmlClassNode::qmlOnly = config.getBool(CONFIG_QMLONLY); -#endif QStringMap reverseAliasMap; diff --git a/tools/qdoc3/doc.h b/tools/qdoc3/doc.h index e043b3a..ea34b1b 100644 --- a/tools/qdoc3/doc.h +++ b/tools/qdoc3/doc.h @@ -70,14 +70,14 @@ class Doc { public: // the order is important - enum SectioningUnit { - Book = -2, - Part, - Chapter, - Section1, - Section2, - Section3, - Section4 + enum Sections { + NoSection = -2, + Part = -1, + Chapter = 1, + Section1 = 1, + Section2 = 2, + Section3 = 3, + Section4 = 4 }; Doc() : priv(0) {} @@ -103,7 +103,7 @@ class Doc Text trimmedBriefText(const QString &className) const; Text legaleseText() const; const QString& baseName() const; - SectioningUnit granularity() const; + Sections granularity() const; const QSet ¶meterNames() const; const QStringList &enumItemNames() const; const QStringList &omitEnumItemNames() const; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index a6cf646..1645ec9 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1792,7 +1792,8 @@ void HtmlGenerator::generateTableOfContents(const Node *node, toc = node->doc().tableOfContents(); if (toc.isEmpty() && !sections && (node->subType() != Node::Module)) return; - + bool debug = false; + QStringList sectionNumber; int detailsBase = 0; diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 2b4c6a0..3596349 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -19,7 +19,7 @@ qdoc_bootstrapped { #CONFIG += debug build_all:!build_pass { CONFIG -= build_all - CONFIG += release + CONFIG += debug-and-release # CONFIG += debug } -- cgit v0.12