From 395f7579c004927f3ac3ac8a5e28817634bfc881 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 24 May 2012 16:08:54 +0200 Subject: Make qdoc compile with QT_STRICT_ITERATORS Change-Id: I2923315678d1aef516b35a8c83fe734367723a28 Reviewed-by: Casper van Donderen --- src/tools/qdoc/htmlgenerator.cpp | 146 +++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 73 deletions(-) (limited to 'src/tools/qdoc/htmlgenerator.cpp') diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 0fdc8bf495..83f3c4af66 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -185,8 +185,8 @@ void HtmlGenerator::initializeGenerator(const Config &config) naturalLanguage = QLatin1String("en"); QSet editionNames = config.subVars(CONFIG_EDITION); - QSet::ConstIterator edition = editionNames.begin(); - while (edition != editionNames.end()) { + QSet::ConstIterator edition = editionNames.constBegin(); + while (edition != editionNames.constEnd()) { QString editionName = *edition; QStringList editionModules = config.getStringList(CONFIG_EDITION + Config::dot + @@ -608,11 +608,11 @@ int HtmlGenerator::generateAtom(const Atom *atom, case Atom::SinceList: { NewSinceMaps::const_iterator nsmap; - nsmap = newSinceMaps.find(atom->string()); + nsmap = newSinceMaps.constFind(atom->string()); NewClassMaps::const_iterator ncmap; - ncmap = newClassMaps.find(atom->string()); + ncmap = newClassMaps.constFind(atom->string()); NewClassMaps::const_iterator nqcmap; - nqcmap = newQmlClassMaps.find(atom->string()); + nqcmap = newQmlClassMaps.constFind(atom->string()); if ((nsmap != newSinceMaps.constEnd()) && !nsmap.value().isEmpty()) { QList
sections; @@ -1231,8 +1231,8 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker) /* sections is built above for the call to generateTableOfContents(). */ - s = sections.begin(); - while (s != sections.end()) { + s = sections.constBegin(); + while (s != sections.constEnd()) { if (s->members.isEmpty() && s->reimpMembers.isEmpty()) { if (!s->inherited.isEmpty()) needOtherSection = true; @@ -1269,8 +1269,8 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker) out() << "

Additional Inherited Members

\n" "
    \n"; - s = sections.begin(); - while (s != sections.end()) { + s = sections.constBegin(); + while (s != sections.constEnd()) { if (s->members.isEmpty() && !s->inherited.isEmpty()) generateSectionInheritedList(*s, inner, marker); ++s; @@ -1293,15 +1293,15 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker) } sections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { + s = sections.constBegin(); + while (s != sections.constEnd()) { //out() << "
    \n"; if (!(*s).divClass.isEmpty()) out() << "
    \n"; // QTBUG-9504 out() << "

    " << protectEnc((*s).name) << "

    \n"; - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { + NodeList::ConstIterator m = (*s).members.constBegin(); + while (m != (*s).members.constEnd()) { if ((*m)->access() != Node::Private) { // ### check necessary? if ((*m)->type() != Node::Class) generateDetailedMember(*m, inner, marker); @@ -1382,8 +1382,8 @@ void HtmlGenerator::generateCollisionPages() NodeList collisions; const NodeList& nl = ncn->childNodes(); if (!nl.isEmpty()) { - NodeList::ConstIterator it = nl.begin(); - while (it != nl.end()) { + NodeList::ConstIterator it = nl.constBegin(); + while (it != nl.constEnd()) { if (!(*it)->isInternal()) collisions.append(*it); ++it; @@ -1420,8 +1420,8 @@ void HtmlGenerator::generateCollisionPages() QList targets; if (!ncn->linkTargets().isEmpty()) { - QMap::ConstIterator t = ncn->linkTargets().begin(); - while (t != ncn->linkTargets().end()) { + QMap::ConstIterator t = ncn->linkTargets().constBegin(); + while (t != ncn->linkTargets().constEnd()) { int count = 0; for (int i=0; i(collisions.at(i)); @@ -1437,8 +1437,8 @@ void HtmlGenerator::generateCollisionPages() } } if (!targets.isEmpty()) { - QList::ConstIterator t = targets.begin(); - while (t != targets.end()) { + QList::ConstIterator t = targets.constBegin(); + while (t != targets.constEnd()) { out() << ""; out() << "

    " << protectEnc(*t) << "

    \n"; out() << "
      \n"; @@ -1588,8 +1588,8 @@ void HtmlGenerator::generateFakeNode(FakeNode* fake, CodeMarker* marker) out() << "
    \n"; } - s = sections.begin(); - while (s != sections.end()) { + s = sections.constBegin(); + while (s != sections.constEnd()) { out() << "" << divNavTop << '\n'; out() << "

    " << protectEnc((*s).name) << "

    \n"; @@ -1608,11 +1608,11 @@ void HtmlGenerator::generateFakeNode(FakeNode* fake, CodeMarker* marker) //out() << "
    \n"; sections = marker->qmlSections(qml_cn,CodeMarker::Detailed); - s = sections.begin(); - while (s != sections.end()) { + s = sections.constBegin(); + while (s != sections.constEnd()) { out() << "

    " << protectEnc((*s).name) << "

    \n"; - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { + NodeList::ConstIterator m = (*s).members.constBegin(); + while (m != (*s).members.constEnd()) { generateDetailedQmlMember(*m, fake, marker); out() << "
    \n"; ++m; @@ -1625,8 +1625,8 @@ void HtmlGenerator::generateFakeNode(FakeNode* fake, CodeMarker* marker) } sections = marker->sections(fake, CodeMarker::Summary, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { + s = sections.constBegin(); + while (s != sections.constEnd()) { out() << "" << divNavTop << '\n'; out() << "

    " << protectEnc((*s).name) << "

    \n"; generateSectionList(*s, fake, marker, CodeMarker::Summary); @@ -1668,13 +1668,13 @@ void HtmlGenerator::generateFakeNode(FakeNode* fake, CodeMarker* marker) } sections = marker->sections(fake, CodeMarker::Detailed, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { + s = sections.constBegin(); + while (s != sections.constEnd()) { //out() << "
    \n"; out() << "

    " << protectEnc((*s).name) << "

    \n"; - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { + NodeList::ConstIterator m = (*s).members.constBegin(); + while (m != (*s).members.constEnd()) { generateDetailedMember(*m, fake, marker); ++m; } @@ -2031,8 +2031,8 @@ void HtmlGenerator::generateTableOfContents(const Node *node, else if (sections && ((node->type() == Node::Class) || (node->type() == Node::Namespace) || (node->subType() == Node::QmlClass))) { - QList
    ::ConstIterator s = sections->begin(); - while (s != sections->end()) { + QList
    ::ConstIterator s = sections->constBegin(); + while (s != sections->constEnd()) { if (!s->members.isEmpty() || !s->reimpMembers.isEmpty()) { out() << "
  • \n"; out() << "

    " << protectEnc(sections.at(i).name) << "

    \n"; - NodeList::ConstIterator m = sections.at(i).members.begin(); - while (m != sections.at(i).members.end()) { + NodeList::ConstIterator m = sections.at(i).members.constBegin(); + while (m != sections.at(i).members.constEnd()) { if ((*m)->access() != Node::Private) generateDetailedMember(*m, inner, marker); ++m; @@ -2235,8 +2235,8 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, return; NodeMap topLevel; - NodeMap::ConstIterator c = classMap.begin(); - while (c != classMap.end()) { + NodeMap::ConstIterator c = classMap.constBegin(); + while (c != classMap.constEnd()) { const ClassNode *classe = static_cast(*c); if (classe->baseClasses().isEmpty()) topLevel.insert(classe->name(), classe); @@ -2254,7 +2254,7 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, } else { const ClassNode *child = - static_cast(*stack.top().begin()); + static_cast(*stack.top().constBegin()); out() << "
  • "; generateFullName(child, relative, marker); out() << "
  • \n"; @@ -2347,8 +2347,8 @@ void HtmlGenerator::generateCompactList(const Node *relative, for (int i=0; i<26; ++i) count[i] = 0; - NodeMap::const_iterator iter = classMap.begin(); - while (iter != classMap.end()) { + NodeMap::const_iterator iter = classMap.constBegin(); + while (iter != classMap.constEnd()) { if (!iter.key().contains("::")) { QChar c = iter.key()[0]; if ((c >= 'A') && (c <= 'Z')) { @@ -2388,8 +2388,8 @@ void HtmlGenerator::generateCompactList(const Node *relative, */ QString first; QString last; - NodeMap::const_iterator iter = classMap.begin(); - while (iter != classMap.end()) { + NodeMap::const_iterator iter = classMap.constBegin(); + while (iter != classMap.constEnd()) { if (!iter.key().contains("::")) { first = iter.key(); break; @@ -2398,10 +2398,10 @@ void HtmlGenerator::generateCompactList(const Node *relative, } if (first.isEmpty()) - first = classMap.begin().key(); + first = classMap.constBegin().key(); - iter = classMap.end(); - while (iter != classMap.begin()) { + iter = classMap.constEnd(); + while (iter != classMap.constBegin()) { --iter; if (!iter.key().contains("::")) { last = iter.key(); @@ -2410,7 +2410,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, } if (last.isEmpty()) - last = classMap.begin().key(); + last = classMap.constBegin().key(); if (classMap.size() > 1) { while (commonPrefixLen < first.length() + 1 && @@ -2433,8 +2433,8 @@ void HtmlGenerator::generateCompactList(const Node *relative, QString paragraphName[NumParagraphs+1]; QSet usedParagraphNames; - NodeMap::ConstIterator c = classMap.begin(); - while (c != classMap.end()) { + NodeMap::ConstIterator c = classMap.constBegin(); + while (c != classMap.constEnd()) { QStringList pieces = c.key().split("::"); QString key; int idx = commonPrefixLen; @@ -2578,8 +2578,8 @@ void HtmlGenerator::generateFunctionIndex(const Node *relative, #if 1 out() << "
      \n"; #endif - QMap::ConstIterator f = funcIndex.begin(); - while (f != funcIndex.end()) { + QMap::ConstIterator f = funcIndex.constBegin(); + while (f != funcIndex.constEnd()) { #if 1 out() << "
    • "; #else @@ -2593,8 +2593,8 @@ void HtmlGenerator::generateFunctionIndex(const Node *relative, nextLetter++; } - NodeMap::ConstIterator s = (*f).begin(); - while (s != (*f).end()) { + NodeMap::ConstIterator s = (*f).constBegin(); + while (s != (*f).constEnd()) { out() << ' '; generateFullName((*s)->parent(), relative, marker, *s); ++s; @@ -2615,8 +2615,8 @@ void HtmlGenerator::generateFunctionIndex(const Node *relative, void HtmlGenerator::generateLegaleseList(const Node *relative, CodeMarker *marker) { - QMap::ConstIterator it = legaleseTexts.begin(); - while (it != legaleseTexts.end()) { + QMap::ConstIterator it = legaleseTexts.constBegin(); + while (it != legaleseTexts.constEnd()) { Text text = it.key(); //out() << "
      \n"; generateText(text, relative, marker); @@ -2626,7 +2626,7 @@ void HtmlGenerator::generateLegaleseList(const Node *relative, generateFullName(it.value(), relative, marker); out() << "
    • \n"; ++it; - } while (it != legaleseTexts.end() && it.key() == text); + } while (it != legaleseTexts.constEnd() && it.key() == text); out() << "
    \n"; } } @@ -2799,8 +2799,8 @@ void HtmlGenerator::generateSection(const NodeList& nl, } int i = 0; - NodeList::ConstIterator m = nl.begin(); - while (m != nl.end()) { + NodeList::ConstIterator m = nl.constBegin(); + while (m != nl.constEnd()) { if ((*m)->access() == Node::Private) { ++m; continue; @@ -2860,8 +2860,8 @@ void HtmlGenerator::generateSectionList(const Section& section, } int i = 0; - NodeList::ConstIterator m = section.members.begin(); - while (m != section.members.end()) { + NodeList::ConstIterator m = section.members.constBegin(); + while (m != section.members.constEnd()) { if ((*m)->access() == Node::Private) { ++m; continue; @@ -2909,8 +2909,8 @@ void HtmlGenerator::generateSectionInheritedList(const Section& section, const Node *relative, CodeMarker *marker) { - QList >::ConstIterator p = section.inherited.begin(); - while (p != section.inherited.end()) { + QList >::ConstIterator p = section.inherited.constBegin(); + while (p != section.inherited.constEnd()) { out() << "
  • "; out() << (*p).second << ' '; if ((*p).second == 1) { @@ -3632,8 +3632,8 @@ void HtmlGenerator::findAllClasses(const InnerNode *node) void HtmlGenerator::findAllFunctions(const InnerNode *node) { - NodeList::ConstIterator c = node->childNodes().begin(); - while (c != node->childNodes().end()) { + NodeList::ConstIterator c = node->childNodes().constBegin(); + while (c != node->childNodes().constEnd()) { if ((*c)->access() != Node::Private) { if ((*c)->isInnerNode() && (*c)->url().isEmpty()) { findAllFunctions(static_cast(*c)); @@ -3654,8 +3654,8 @@ void HtmlGenerator::findAllFunctions(const InnerNode *node) void HtmlGenerator::findAllLegaleseTexts(const InnerNode *node) { - NodeList::ConstIterator c = node->childNodes().begin(); - while (c != node->childNodes().end()) { + NodeList::ConstIterator c = node->childNodes().constBegin(); + while (c != node->childNodes().constEnd()) { if ((*c)->access() != Node::Private) { if (!(*c)->doc().legaleseText().isEmpty()) legaleseTexts.insertMulti((*c)->doc().legaleseText(), *c); @@ -3668,8 +3668,8 @@ void HtmlGenerator::findAllLegaleseTexts(const InnerNode *node) void HtmlGenerator::findAllNamespaces(const InnerNode *node) { - NodeList::ConstIterator c = node->childNodes().begin(); - while (c != node->childNodes().end()) { + NodeList::ConstIterator c = node->childNodes().constBegin(); + while (c != node->childNodes().constEnd()) { if ((*c)->access() != Node::Private) { if ((*c)->isInnerNode() && (*c)->url().isEmpty()) { findAllNamespaces(static_cast(*c)); @@ -4033,8 +4033,8 @@ void HtmlGenerator::generateQmlSummary(const Section& section, if (!section.members.isEmpty()) { out() << "
      \n"; NodeList::ConstIterator m; - m = section.members.begin(); - while (m != section.members.end()) { + m = section.members.constBegin(); + while (m != section.members.constEnd()) { out() << "
    • "; generateQmlItem(*m,relative,marker,true); out() << "
    • \n"; @@ -4060,10 +4060,10 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, out() << "
      "; if (node->subType() == Node::QmlPropertyGroup) { const QmlPropGroupNode* qpgn = static_cast(node); - NodeList::ConstIterator p = qpgn->childNodes().begin(); + NodeList::ConstIterator p = qpgn->childNodes().constBegin(); out() << "
      "; out() << ""; - while (p != qpgn->childNodes().end()) { + while (p != qpgn->childNodes().constEnd()) { if ((*p)->type() == Node::QmlProperty) { qpn = static_cast(*p); out() << ""; @@ -4125,10 +4125,10 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, Process the whole list as we would for a QML property group. */ - NodeList::ConstIterator p = qpn->qmlPropNodes().begin(); + NodeList::ConstIterator p = qpn->qmlPropNodes().constBegin(); out() << "
      "; out() << "
      "; - while (p != qpn->qmlPropNodes().end()) { + while (p != qpn->qmlPropNodes().constEnd()) { if ((*p)->type() == Node::QmlProperty) { QmlPropertyNode* q = static_cast(*p); out() << ""; -- cgit v1.2.3