diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-07-30 13:28:49 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-07-30 13:28:49 (GMT) |
commit | a08b3f5336e5c819b33d922d3a809b5203d728f3 (patch) | |
tree | 952f42304d50f28ed6651bace587ab7935b29cd0 /tools | |
parent | 813fc3574a006cb2687715ccf7bdb984a485b173 (diff) | |
parent | 188ac02e2fb6cc6437b776f8c5b69a508728fbdb (diff) | |
download | Qt-a08b3f5336e5c819b33d922d3a809b5203d728f3.zip Qt-a08b3f5336e5c819b33d922d3a809b5203d728f3.tar.gz Qt-a08b3f5336e5c819b33d922d3a809b5203d728f3.tar.bz2 |
Merge commit 'qt/master-stable'
Conflicts:
demos/demos.pro
src/gui/graphicsview/qgraphicsitem_p.h
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/tools/qhelpconverter/adpreader.cpp | 20 | ||||
-rw-r--r-- | tools/assistant/tools/qhelpconverter/adpreader.h | 6 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 13 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 1 |
4 files changed, 29 insertions, 11 deletions
diff --git a/tools/assistant/tools/qhelpconverter/adpreader.cpp b/tools/assistant/tools/qhelpconverter/adpreader.cpp index 35f8878..c427038 100644 --- a/tools/assistant/tools/qhelpconverter/adpreader.cpp +++ b/tools/assistant/tools/qhelpconverter/adpreader.cpp @@ -39,8 +39,16 @@ ** ****************************************************************************/ +#include <QRegExp> + #include "adpreader.h" +static bool versionIsAtLeast320(const QString &version) +{ + return QRegExp("\\d.\\d\\.\\d").exactMatch(version) + && (version[0] > '3' || (version[0] == '3' && version[2] >= '2')); +} + QT_BEGIN_NAMESPACE void AdpReader::readData(const QByteArray &contents) @@ -51,11 +59,11 @@ void AdpReader::readData(const QByteArray &contents) m_properties.clear(); m_files.clear(); addData(contents); - while (!atEnd()) { - readNext(); - if (isStartElement()) { + while (!atEnd()) { + readNext(); + if (isStartElement()) { if (name().toString().toLower() == QLatin1String("assistantconfig") - && attributes().value(QLatin1String("version")) == QLatin1String("3.2.0")) { + && versionIsAtLeast320(attributes().value(QLatin1String("version")).toString())) { readProject(); } else if (name().toString().toLower() == QLatin1String("dcf")) { QString ref = attributes().value(QLatin1String("ref")).toString(); @@ -66,8 +74,8 @@ void AdpReader::readData(const QByteArray &contents) } else { raiseError(); } - } - } + } + } } QList<ContentItem> AdpReader::contents() const diff --git a/tools/assistant/tools/qhelpconverter/adpreader.h b/tools/assistant/tools/qhelpconverter/adpreader.h index f2e7509..740a462 100644 --- a/tools/assistant/tools/qhelpconverter/adpreader.h +++ b/tools/assistant/tools/qhelpconverter/adpreader.h @@ -50,15 +50,15 @@ QT_BEGIN_NAMESPACE struct ContentItem { ContentItem(const QString &t, const QString &r, int d) - : title(t), reference(r), depth(d) {} + : title(t), reference(r), depth(d) {} QString title; QString reference; - int depth; + int depth; }; struct KeywordItem { KeywordItem(const QString &k, const QString &r) - : keyword(k), reference(r) {} + : keyword(k), reference(r) {} QString keyword; QString reference; }; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index ab74f13..f92391e 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2881,7 +2881,9 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, } #endif -void HtmlGenerator::generateLink(const Atom *atom, const Node * /* relative */, CodeMarker *marker) +void HtmlGenerator::generateLink(const Atom* atom, + const Node* /* relative */, + CodeMarker* marker) { static QRegExp camelCase("[A-Z][A-Z][a-z]|[a-z][A-Z0-9]|_"); @@ -3472,6 +3474,7 @@ QString HtmlGenerator::getLink(const Atom *atom, { QString link; *node = 0; + inObsoleteLink = false; if (atom->string().contains(":") && (atom->string().startsWith("file:") @@ -3530,10 +3533,12 @@ QString HtmlGenerator::getLink(const Atom *atom, porting = true; } QString name = marker->plainFullName(relative); - if (!porting && !name.startsWith("Q3")) + if (!porting && !name.startsWith("Q3")) { relative->doc().location().warning(tr("Link to obsolete item '%1' in %2") .arg(atom->string()) .arg(name)); + inObsoleteLink = true; + } #if 0 qDebug() << "Link to Obsolete entity" << (*node)->name(); @@ -3689,10 +3694,14 @@ void HtmlGenerator::endLink() out() << "</i>"; } else { + if (inObsoleteLink) { + out() << "<sup>(obsolete)</sup>"; + } out() << "</a>"; } } inLink = false; + inObsoleteLink = false; } QT_END_NAMESPACE diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index a7f4009..a7632cd 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -230,6 +230,7 @@ class HtmlGenerator : public PageGenerator DcfSection dcfQmakeRoot; HelpProjectWriter *helpProjectWriter; bool inLink; + bool inObsoleteLink; bool inContents; bool inSectionHeading; bool inTableHeader; |