diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index dfd3e03550..ed92fc4722 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -1022,10 +1022,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, generateAnnotatedList(relative, marker, qdb_->getCppClasses()); } else if (atom->string() == "classes") { - generateCompactList(Generic, relative, qdb_->getCppClasses(), true); + generateCompactList(Generic, relative, qdb_->getCppClasses(), true, QStringLiteral("Q")); } else if (atom->string() == "qmlclasses") { - generateCompactList(Generic, relative, qdb_->getQmlTypes(), true); + generateCompactList(Generic, relative, qdb_->getQmlTypes(), true, QStringLiteral("")); } else if (atom->string().contains("classesbymodule")) { QString arg = atom->string().trimmed(); @@ -1044,19 +1044,21 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, generateClassHierarchy(relative, qdb_->getCppClasses()); } else if (atom->string() == "compatclasses") { - generateCompactList(Generic, relative, qdb_->getCompatibilityClasses(), false); + // "compatclasses" is no longer used. Delete this at some point. + // mws 03/10/2013 + generateCompactList(Generic, relative, qdb_->getCompatibilityClasses(), false, QStringLiteral("Q")); } else if (atom->string() == "obsoleteclasses") { - generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false); + generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false, QStringLiteral("Q")); } else if (atom->string() == "obsoleteqmltypes") { - generateCompactList(Generic, relative, qdb_->getObsoleteQmlTypes(), false); + generateCompactList(Generic, relative, qdb_->getObsoleteQmlTypes(), false, QStringLiteral("")); } else if (atom->string() == "obsoletecppmembers") { - generateCompactList(Obsolete, relative, qdb_->getClassesWithObsoleteMembers(), false); + generateCompactList(Obsolete, relative, qdb_->getClassesWithObsoleteMembers(), false, QStringLiteral("Q")); } else if (atom->string() == "obsoleteqmlmembers") { - generateCompactList(Obsolete, relative, qdb_->getQmlTypesWithObsoleteMembers(), false); + generateCompactList(Obsolete, relative, qdb_->getQmlTypesWithObsoleteMembers(), false, QStringLiteral("")); } else if (atom->string() == "functionindex") { generateFunctionIndex(relative); @@ -1065,10 +1067,14 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, generateLegaleseList(relative, marker); } else if (atom->string() == "mainclasses") { - generateCompactList(Generic, relative, qdb_->getMainClasses(), true); + // "mainclasses" is no longer used. Delete this at some point. + // mws 03/10/2013 + generateCompactList(Generic, relative, qdb_->getMainClasses(), true, QStringLiteral("Q")); } else if (atom->string() == "services") { - generateCompactList(Generic, relative, qdb_->getServiceClasses(), false); + // "services" is no longer used. Delete this at some point. + // mws 03/10/2013 + generateCompactList(Generic, relative, qdb_->getServiceClasses(), false, QStringLiteral("Q")); } else if (atom->string() == "overviews") { generateOverviewList(relative); diff --git a/src/tools/qdoc/ditaxmlgenerator.h b/src/tools/qdoc/ditaxmlgenerator.h index a58504d7c7..da05bb0274 100644 --- a/src/tools/qdoc/ditaxmlgenerator.h +++ b/src/tools/qdoc/ditaxmlgenerator.h @@ -381,7 +381,7 @@ private: const Node* relative, const NodeMap& classMap, bool includeAlphabet, - QString commonPrefix = QString()); + QString commonPrefix); void generateFunctionIndex(const Node* relative); void generateLegaleseList(const Node* relative, CodeMarker* marker); void generateOverviewList(const Node* relative); diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 6004f3e398..2387502b8a 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -491,7 +491,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark generateAnnotatedList(relative, marker, qdb_->getCppClasses()); } else if (atom->string() == "classes") { - generateCompactList(Generic, relative, qdb_->getCppClasses(), true); + generateCompactList(Generic, relative, qdb_->getCppClasses(), true, QStringLiteral("Q")); } else if (atom->string() == "qmltypes") { generateCompactList(Generic, relative, qdb_->getQmlTypes(), true, QStringLiteral("")); @@ -513,16 +513,18 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark generateClassHierarchy(relative, qdb_->getCppClasses()); } else if (atom->string() == "compatclasses") { - generateCompactList(Generic, relative, qdb_->getCompatibilityClasses(), false); + // "compatclasses" is no longer used. Delete this at some point. + // mws 03/10/2013 + generateCompactList(Generic, relative, qdb_->getCompatibilityClasses(), false, QStringLiteral("Q")); } else if (atom->string() == "obsoleteclasses") { - generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false); + generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false, QStringLiteral("Q")); } else if (atom->string() == "obsoleteqmltypes") { generateCompactList(Generic, relative, qdb_->getObsoleteQmlTypes(), false, QStringLiteral("")); } else if (atom->string() == "obsoletecppmembers") { - generateCompactList(Obsolete, relative, qdb_->getClassesWithObsoleteMembers(), false); + generateCompactList(Obsolete, relative, qdb_->getClassesWithObsoleteMembers(), false, QStringLiteral("Q")); } else if (atom->string() == "obsoleteqmlmembers") { generateCompactList(Obsolete, relative, qdb_->getQmlTypesWithObsoleteMembers(), false, QStringLiteral("")); @@ -534,10 +536,14 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark generateLegaleseList(relative, marker); } else if (atom->string() == "mainclasses") { - generateCompactList(Generic, relative, qdb_->getMainClasses(), true); + // "mainclasses" is no longer used. Delete this at some point. + // mws 03/10/2013 + generateCompactList(Generic, relative, qdb_->getMainClasses(), true, QStringLiteral("Q")); } else if (atom->string() == "services") { - generateCompactList(Generic, relative, qdb_->getServiceClasses(), false); + // "services" is no longer used. Delete this at some point. + // mws 03/10/2013 + generateCompactList(Generic, relative, qdb_->getServiceClasses(), false, QStringLiteral("Q")); } else if (atom->string() == "overviews") { generateOverviewList(relative); @@ -2535,49 +2541,11 @@ void HtmlGenerator::generateCompactList(ListType listType, bool includeAlphabet, QString commonPrefix) { - const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' - if (classMap.isEmpty()) return; - /* - If commonPrefix is not empty, then the caller knows what - the common prefix is and has passed it in, so just use that - one. But if commonPrefix is a null string (default value), then - compute a common prefix using this simple algorithm. Note we - assume the prefix length is 1, i.e. we will have a single - character as the common prefix. - */ + const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' int commonPrefixLen = commonPrefix.length(); - if (commonPrefix.isNull()) { - QVector count(26); - for (int i=0; i<26; ++i) - count[i] = 0; - - NodeMap::const_iterator iter = classMap.constBegin(); - while (iter != classMap.constEnd()) { - if (!iter.key().contains("::")) { - QChar c = iter.key()[0]; - if ((c >= 'A') && (c <= 'Z')) { - int idx = c.unicode() - QChar('A').unicode(); - ++count[idx]; - } - } - ++iter; - } - int highest = 0; - int idx = -1; - for (int i=0; i<26; ++i) { - if (count[i] > highest) { - highest = count[i]; - idx = i; - } - } - idx += QChar('A').unicode(); - QChar common(idx); - commonPrefix = common; - commonPrefixLen = 1; - } /* Divide the data into 37 paragraphs: 0, ..., 9, A, ..., Z, diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h index 8cd8664dfc..f2525327e8 100644 --- a/src/tools/qdoc/htmlgenerator.h +++ b/src/tools/qdoc/htmlgenerator.h @@ -164,7 +164,7 @@ private: const Node *relative, const NodeMap &classMap, bool includeAlphabet, - QString commonPrefix = QString()); + QString commonPrefix); void generateFunctionIndex(const Node *relative); void generateLegaleseList(const Node *relative, CodeMarker *marker); void generateOverviewList(const Node *relative);