summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-08 12:18:02 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-08 12:18:02 (GMT)
commit2a793356005bda3d99ce58bf0197d9b3b8fd8578 (patch)
treef20f9df1930e6ecad8432905a915903394563125 /tools
parent21fef75cd50b00609a803f123cc27ad0ee9ba509 (diff)
parente0405b6b42ddf794935af27a0265ca259c73ce4c (diff)
downloadQt-2a793356005bda3d99ce58bf0197d9b3b8fd8578.zip
Qt-2a793356005bda3d99ce58bf0197d9b3b8fd8578.tar.gz
Qt-2a793356005bda3d99ce58bf0197d9b3b8fd8578.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tools')
-rw-r--r--tools/qdoc3/qdoc3.pro4
-rw-r--r--tools/qdoc3/tree.cpp80
2 files changed, 50 insertions, 34 deletions
diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro
index 5438e5f..ed27669 100644
--- a/tools/qdoc3/qdoc3.pro
+++ b/tools/qdoc3/qdoc3.pro
@@ -1,8 +1,8 @@
DEFINES += QDOC2_COMPAT
DEFINES += QT_NO_CAST_TO_ASCII
#DEFINES += QT_NO_CAST_FROM_ASCII
-DEFINES += QT_USE_FAST_OPERATOR_PLUS
-DEFINES += QT_USE_FAST_CONCATENATION
+#DEFINES += QT_USE_FAST_OPERATOR_PLUS
+#DEFINES += QT_USE_FAST_CONCATENATION
QT = core xml
CONFIG += console
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index 0fbd438..370bd5a 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -1884,23 +1884,25 @@ QString Tree::fullDocumentLocation(const Node *node) const
if (!node->url().isEmpty())
return node->url();
+ QString parentName;
+ QString anchorRef;
+
if (node->type() == Node::Namespace) {
// The root namespace has no name - check for this before creating
// an attribute containing the location of any documentation.
if (!node->fileBase().isEmpty())
- return node->fileBase() + ".html";
+ parentName = node->fileBase() + ".html";
else
return "";
}
else if (node->type() == Node::Fake) {
- return node->fileBase() + ".html";
+ parentName = node->fileBase() + ".html";
}
else if (node->fileBase().isEmpty())
return "";
- QString parentName;
Node *parentNode = 0;
if ((parentNode = node->relates()))
@@ -1912,10 +1914,11 @@ QString Tree::fullDocumentLocation(const Node *node) const
case Node::Class:
case Node::Namespace:
if (parentNode && !parentNode->name().isEmpty())
- return parentName.replace(".html", "") + "-"
- + node->fileBase().toLower() + ".html";
+ parentName = parentName.replace(".html", "") + "-"
+ + node->fileBase().toLower() + ".html";
else
- return node->fileBase() + ".html";
+ parentName = node->fileBase() + ".html";
+ break;
case Node::Function:
{
/*
@@ -1925,29 +1928,17 @@ QString Tree::fullDocumentLocation(const Node *node) const
const FunctionNode *functionNode =
static_cast<const FunctionNode *>(node);
- // Functions can be compatibility functions or be obsolete.
- switch (node->status()) {
- case Node::Compat:
- parentName.replace(".html", "-qt3.html");
- break;
- case Node::Obsolete:
- parentName.replace(".html", "-obsolete.html");
- break;
- default:
- ;
- }
-
if (functionNode->metaness() == FunctionNode::Dtor)
- return parentName + "#dtor." + functionNode->name().mid(1);
+ anchorRef = "#dtor." + functionNode->name().mid(1);
- if (functionNode->associatedProperty())
+ else if (functionNode->associatedProperty())
return fullDocumentLocation(functionNode->associatedProperty());
- if (functionNode->overloadNumber() > 1)
- return parentName + "#" + functionNode->name()
- + "-" + QString::number(functionNode->overloadNumber());
+ else if (functionNode->overloadNumber() > 1)
+ anchorRef = "#" + functionNode->name()
+ + "-" + QString::number(functionNode->overloadNumber());
else
- return parentName + "#" + functionNode->name();
+ anchorRef = "#" + functionNode->name();
}
/*
@@ -1955,27 +1946,52 @@ QString Tree::fullDocumentLocation(const Node *node) const
the latter returns the name in lower-case. For
HTML anchors, we need to preserve the case.
*/
+ break;
case Node::Enum:
- return parentName + "#" + node->name() + "-enum";
+ anchorRef = "#" + node->name() + "-enum";
+ break;
case Node::Typedef:
- return parentName + "#" + node->name() + "-typedef";
+ anchorRef = "#" + node->name() + "-typedef";
+ break;
case Node::Property:
- return parentName + "#" + node->name() + "-prop";
+ anchorRef = "#" + node->name() + "-prop";
+ break;
case Node::Variable:
- return parentName + "#" + node->name() + "-var";
+ anchorRef = "#" + node->name() + "-var";
+ break;
case Node::Target:
- return parentName + "#" + Doc::canonicalTitle(node->name());
+ anchorRef = "#" + Doc::canonicalTitle(node->name());
+ break;
case Node::Fake:
{
- QString pageName = node->name();
- return pageName.replace("/", "-").replace(".", "-") + ".html";
+ /*
+ Use node->fileBase() for fake nodes because they are represented
+ by pages whose file names are lower-case.
+ */
+ parentName = node->fileBase();
+ parentName.replace("/", "-").replace(".", "-");
+ parentName += ".html";
}
break;
default:
break;
}
- return "";
+ // Various objects can be compat (deprecated) or obsolete.
+ if (node->type() != Node::Class && node->type() != Node::Namespace) {
+ switch (node->status()) {
+ case Node::Compat:
+ parentName.replace(".html", "-qt3.html");
+ break;
+ case Node::Obsolete:
+ parentName.replace(".html", "-obsolete.html");
+ break;
+ default:
+ ;
+ }
+ }
+
+ return parentName.toLower() + anchorRef;
}
/*!