diff options
author | Topi Reinio <topi.reinio@digia.com> | 2013-09-30 14:21:15 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-02 10:07:19 +0200 |
commit | 803253ba7320970a559d0ea92af7b87f3d7200e4 (patch) | |
tree | 623aec620c09a92762a797e1aeaf9b920ccc981d /src/tools | |
parent | 09824fd33430ec44dc2b78db06a57c6f10726daf (diff) |
qdoc: Use empty common prefix for alphabetical QML type lists
This change allows an empty string to be used as a common prefix
for class/type compact lists, and uses it for QML types as they
do not have a common prefix like public C++ Qt classes do.
This fixes the issue with sorting order for QML type lists.
Task-number: QTBUG-33715
Change-Id: I28ab689d28017ae28eccbf590d1dbbe107665e33
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/qdoc/htmlgenerator.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 697955629e..835443a6a2 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -494,7 +494,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark generateCompactList(Generic, relative, qdb_->getCppClasses(), true); } else if (atom->string() == "qmltypes") { - generateCompactList(Generic, relative, qdb_->getQmlTypes(), true); + generateCompactList(Generic, relative, qdb_->getQmlTypes(), true, QStringLiteral("")); } else if (atom->string().contains("classesbymodule")) { QString arg = atom->string().trimmed(); @@ -519,13 +519,13 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false); } 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); } 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); @@ -670,9 +670,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark << "\"></a>\n"; out() << "<h3>" << protectEnc((*s).name) << "</h3>\n"; if (idx == Class) - generateCompactList(Generic, 0, ncmap, false, QString("Q")); + generateCompactList(Generic, 0, ncmap, false, QStringLiteral("Q")); else if (idx == QmlClass) - generateCompactList(Generic, 0, nqcmap, false, QString("Q")); + generateCompactList(Generic, 0, nqcmap, false, QStringLiteral("")); else if (idx == MemberFunction) { ParentMaps parentmaps; ParentMaps::iterator pmap; @@ -2543,13 +2543,13 @@ void HtmlGenerator::generateCompactList(ListType listType, /* 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 the commonPrefix is empty (it normally is), then + 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. */ int commonPrefixLen = commonPrefix.length(); - if (commonPrefixLen == 0) { + if (commonPrefix.isNull()) { QVector<int> count(26); for (int i=0; i<26; ++i) count[i] = 0; @@ -2594,7 +2594,7 @@ void HtmlGenerator::generateCompactList(ListType listType, QStringList pieces = c.key().split("::"); QString key; int idx = commonPrefixLen; - if (!pieces.last().startsWith(commonPrefix)) + if (idx > 0 && !pieces.last().startsWith(commonPrefix)) idx = 0; if (pieces.size() == 1) key = pieces.last().mid(idx).toLower(); |