diff options
| author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-04 05:56:06 +0000 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2015-06-04 05:56:06 +0000 |
| commit | ccad00121d0a9d703cf715c54347b32bfc33bbfc (patch) | |
| tree | 8e492f00f9ea81d87ae9126ad06c3dbc21fee3a3 /src/tools/qdoc/htmlgenerator.cpp | |
| parent | dc2617f35be61b4827b8e3d192c85e2feacf7f6a (diff) | |
| parent | e2f66f921594b7be4af4a058c959557489e86879 (diff) | |
Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev
Diffstat (limited to 'src/tools/qdoc/htmlgenerator.cpp')
| -rw-r--r-- | src/tools/qdoc/htmlgenerator.cpp | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 18e538ef7b6..e80187ec93b 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -2191,7 +2191,7 @@ void HtmlGenerator::generateRequisites(Aggregate *inner, CodeMarker *marker) out() << "<div class=\"table\"><table class=\"alignedsummary\">\n"; QStringList::ConstIterator i; - for (i = requisiteorder.begin(); i != requisiteorder.constEnd(); ++i) { + for (i = requisiteorder.constBegin(); i != requisiteorder.constEnd(); ++i) { if (requisites.contains(*i)) { out() << "<tr>" @@ -2311,7 +2311,7 @@ void HtmlGenerator::generateQmlRequisites(QmlTypeNode *qcn, CodeMarker *marker) out() << "<div class=\"table\"><table class=\"alignedsummary\">\n"; QStringList::ConstIterator i; - for (i = requisiteorder.begin(); i != requisiteorder.constEnd(); ++i) { + for (i = requisiteorder.constBegin(); i != requisiteorder.constEnd(); ++i) { if (requisites.contains(*i)) { out() << "<tr>" @@ -4536,33 +4536,49 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString writer.writeCDATA(QString("No description available")); writer.writeEndElement(); // description - // Add words from module name as tags (QtQuickControls -> qt,quick,controls) - QRegExp re("([A-Z]+[a-z0-9]*)"); + // Add words from module name as tags + // QtQuickControls -> qt,quick,controls + // QtOpenGL -> qt,opengl + QRegExp re("([A-Z]+[a-z0-9]*(3D|GL)?)"); int pos = 0; while ((pos = re.indexIn(project, pos)) != -1) { tags << re.cap(1).toLower(); pos += re.matchedLength(); } tags += QSet<QString>::fromList(en->title().toLower().split(QLatin1Char(' '))); + + // Clean up tags, exclude invalid and common words + QSet<QString>::iterator tag_it = tags.begin(); + QSet<QString> modified; + while (tag_it != tags.end()) { + QString s = *tag_it; + if (s.at(0) == '(') + s.remove(0, 1).chop(1); + if (s.endsWith(QLatin1Char(':'))) + s.chop(1); + + if (s.length() < 2 + || s.at(0).isDigit() + || s.at(0) == '-' + || s == QStringLiteral("qt") + || s == QStringLiteral("the") + || s == QStringLiteral("and") + || s.startsWith(QStringLiteral("example")) + || s.startsWith(QStringLiteral("chapter"))) + tag_it = tags.erase(tag_it); + else if (s != *tag_it) { + modified << s; + tag_it = tags.erase(tag_it); + } + else + ++tag_it; + } + tags += modified; + if (!tags.isEmpty()) { writer.writeStartElement("tags"); bool wrote_one = false; - // Exclude invalid and common words foreach (QString tag, tags) { - if (tag.length() < 2) - continue; - if (tag.at(0).isDigit()) - continue; - if (tag.at(0) == '-') - continue; - if (tag == QLatin1String("qt")) - continue; - if (tag.startsWith("example")) - continue; - if (tag.startsWith("chapter")) - continue; - if (tag.endsWith(QLatin1Char(':'))) - tag.chop(1); if (wrote_one) writer.writeCharacters(","); writer.writeCharacters(tag); |
