summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/htmlgenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/qdoc/htmlgenerator.cpp')
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp65
1 files changed, 37 insertions, 28 deletions
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 3fb6acf72b..d7a17fce26 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -474,14 +474,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
static bool in_para = false;
switch (atom->type()) {
- case Atom::AbstractLeft:
- if (relative)
- relative->doc().location().warning(tr("\abstract is not implemented."));
- else
- Location::information(tr("\abstract is not implemented."));
- break;
- case Atom::AbstractRight:
- break;
case Atom::AutoLink:
case Atom::NavAutoLink:
if (!inLink_ && !inContents_ && !inSectionHeading_) {
@@ -2199,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>"
@@ -2319,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>"
@@ -3559,7 +3551,8 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
bool handled = false;
for (int k = 0; k != 18; ++k) {
const QString & tag = spanTags[2 * k];
- if (tag == QStringRef(&src, i, tag.length())) {
+ if (i + tag.length() <= src.length() &&
+ tag == QStringRef(&src, i, tag.length())) {
html += spanTags[2 * k + 1];
i += tag.length();
handled = true;
@@ -4544,33 +4537,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);