summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qdoc3')
-rw-r--r--tools/qdoc3/htmlgenerator.cpp83
-rw-r--r--tools/qdoc3/htmlgenerator.h3
-rw-r--r--tools/qdoc3/qdoc3.pro5
3 files changed, 69 insertions, 22 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index c007b9b..d82e9f8 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -294,6 +294,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker)
nonCompatClasses.clear();
mainClasses.clear();
compatClasses.clear();
+ obsoleteClasses.clear();
moduleClassMap.clear();
moduleNamespaceMap.clear();
funcIndex.clear();
@@ -381,7 +382,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
case Atom::AutoLink:
if (!inLink && !inContents && !inSectionHeading) {
const Node *node = 0;
- QString link = getLink(atom, relative, marker, node);
+ QString link = getLink(atom, relative, marker, &node);
if (!link.isEmpty()) {
beginLink(link, node, relative, marker);
generateLink(atom, relative, marker);
@@ -567,6 +568,9 @@ int HtmlGenerator::generateAtom(const Atom *atom,
else if (atom->string() == "compatclasses") {
generateCompactList(relative, marker, compatClasses);
}
+ else if (atom->string() == "obsoleteclasses") {
+ generateCompactList(relative, marker, obsoleteClasses);
+ }
else if (atom->string() == "functionindex") {
generateFunctionIndex(relative, marker);
}
@@ -648,11 +652,12 @@ int HtmlGenerator::generateAtom(const Atom *atom,
case Atom::Link:
{
const Node *node = 0;
- QString myLink = getLink(atom, relative, marker, node);
- if (myLink.isEmpty())
+ QString myLink = getLink(atom, relative, marker, &node);
+ if (myLink.isEmpty()) {
relative->doc().location().warning(tr("Cannot link to '%1' in %2")
.arg(atom->string())
.arg(marker->plainFullName(relative)));
+ }
beginLink(myLink, node, relative, marker);
skipAhead = 1;
}
@@ -1843,6 +1848,9 @@ HtmlGenerator::generateAnnotatedList(const Node *relative,
foreach (const QString &name, nodeMap.keys()) {
const Node *node = nodeMap[name];
+ if (node->status() == Node::Obsolete)
+ continue;
+
if (++row % 2 == 1)
out() << "<tr valign=\"top\" class=\"odd\">";
else
@@ -3261,6 +3269,9 @@ void HtmlGenerator::findAllClasses(const InnerNode *node)
if ((*c)->status() == Node::Compat) {
compatClasses.insert(className, *c);
}
+ else if ((*c)->status() == Node::Obsolete) {
+ obsoleteClasses.insert(className, *c);
+ }
else {
nonCompatClasses.insert(className, *c);
if ((*c)->status() == Node::Main)
@@ -3457,10 +3468,10 @@ const QPair<QString,QString> HtmlGenerator::anchorForNode(const Node *node)
QString HtmlGenerator::getLink(const Atom *atom,
const Node *relative,
CodeMarker *marker,
- const Node *node)
+ const Node** node)
{
QString link;
- node = 0;
+ *node = 0;
if (atom->string().contains(":") &&
(atom->string().startsWith("file:")
@@ -3484,40 +3495,74 @@ QString HtmlGenerator::getLink(const Atom *atom,
QString first = path.first().trimmed();
if (first.isEmpty()) {
- node = relative;
+ *node = relative;
}
else if (first.endsWith(".html")) {
- node = tre->root()->findNode(first, Node::Fake);
+ *node = tre->root()->findNode(first, Node::Fake);
}
else {
- node = marker->resolveTarget(first, tre, relative);
- if (!node)
- node = tre->findFakeNodeByTitle(first);
- if (!node)
- node = tre->findUnambiguousTarget(first, targetAtom);
+ *node = marker->resolveTarget(first, tre, relative);
+ if (!*node)
+ *node = tre->findFakeNodeByTitle(first);
+ if (!*node)
+ *node = tre->findUnambiguousTarget(first, targetAtom);
}
- if (node) {
- if (!node->url().isEmpty())
- return node->url();
+ if (*node) {
+ if (!(*node)->url().isEmpty())
+ return (*node)->url();
else
path.removeFirst();
}
else {
- node = relative;
+ *node = relative;
+ }
+
+ if (*node) {
+ if ((*node)->status() == Node::Obsolete) {
+ if (relative) {
+ if (relative->parent() != *node) {
+ if (relative->status() != Node::Obsolete) {
+ relative->doc().location().warning(tr("Link to obsolete item '%1' in %2")
+ .arg(atom->string())
+ .arg(marker->plainFullName(relative)));
+#if 0
+ qDebug() << "Link to Obsolete entity"
+ << (*node)->name();
+ qDebug() << " relative entity"
+ << relative->name();
+#endif
+ }
+ }
+ }
+ else {
+ qDebug() << "Link to Obsolete entity"
+ << (*node)->name() << "no relative";
+ }
+ }
+#if 0
+ else if ((*node)->status() == Node::Deprecated) {
+ qDebug() << "Link to Deprecated entity";
+ }
+ else if ((*node)->status() == Node::Internal) {
+ qDebug() << "Link to Internal entity";
+ }
+ //else
+ //qDebug() << "Node Status:" << (*node)->status();
+#endif
}
while (!path.isEmpty()) {
- targetAtom = tre->findTarget(path.first(), node);
+ targetAtom = tre->findTarget(path.first(), *node);
if (targetAtom == 0)
break;
path.removeFirst();
}
if (path.isEmpty()) {
- link = linkForNode(node, relative);
+ link = linkForNode(*node, relative);
if (targetAtom)
- link += "#" + refForAtom(targetAtom, node);
+ link += "#" + refForAtom(targetAtom, *node);
}
}
return link;
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index dc5e5cf..a7f4009 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -202,7 +202,7 @@ class HtmlGenerator : public PageGenerator
virtual QString getLink(const Atom *atom,
const Node *relative,
CodeMarker *marker,
- const Node *node = 0);
+ const Node** node);
virtual void generateDcf(const QString &fileBase,
const QString &startPage,
const QString &title, DcfSection &dcfRoot);
@@ -256,6 +256,7 @@ class HtmlGenerator : public PageGenerator
QMap<QString, const Node *> nonCompatClasses;
QMap<QString, const Node *> mainClasses;
QMap<QString, const Node *> compatClasses;
+ QMap<QString, const Node *> obsoleteClasses;
QMap<QString, const Node *> namespaceIndex;
QMap<QString, const Node *> serviceClasses;
#ifdef QDOC_QML
diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro
index 1291272..49a16e6 100644
--- a/tools/qdoc3/qdoc3.pro
+++ b/tools/qdoc3/qdoc3.pro
@@ -7,10 +7,11 @@ DEFINES += QT_NO_CAST_TO_ASCII
QT = core xml
CONFIG += console
CONFIG -= debug_and_release_target
-CONFIG += debug
+#CONFIG += debug
build_all:!build_pass {
CONFIG -= build_all
- CONFIG += debug
+ CONFIG += release
+# CONFIG += debug
}
mac:CONFIG -= app_bundle
HEADERS += apigenerator.h \