summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-07-28 13:04:16 (GMT)
committerMartin Smith <msmith@trolltech.com>2009-07-28 13:04:52 (GMT)
commite61e40d1b89ef13d4cd65853df859945c357af93 (patch)
treef0f4dc9d3629089e20458dadecd2fd4499f7be28
parent2d9448d1c9bcf843e36931a9109fd9bd8d42b2be (diff)
downloadQt-e61e40d1b89ef13d4cd65853df859945c357af93.zip
Qt-e61e40d1b89ef13d4cd65853df859945c357af93.tar.gz
Qt-e61e40d1b89ef13d4cd65853df859945c357af93.tar.bz2
qdoc: Added superscript obsolete to obsolete links.
Only for obsolete links from non-obsolete things.
-rw-r--r--tools/qdoc3/htmlgenerator.cpp13
-rw-r--r--tools/qdoc3/htmlgenerator.h1
2 files changed, 12 insertions, 2 deletions
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;