summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/cppcodemarker.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-04-10 12:48:01 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-04-10 15:31:45 +0200
commit143c4d3e13a430b951f4f4f8c28db14303f80605 (patch)
tree2b89637b93fc7d81c674106008566010f986d67c /src/tools/qdoc/cppcodemarker.cpp
parenta7ed81b557d593a8ddb43b71bf4bbf3b44ead070 (diff)
parente5337ad1b1fb02873ce7b5ca8db45f6fd8063352 (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
Diffstat (limited to 'src/tools/qdoc/cppcodemarker.cpp')
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp57
1 files changed, 17 insertions, 40 deletions
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
index 3e7d190fe4..aea8ed2119 100644
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ b/src/tools/qdoc/cppcodemarker.cpp
@@ -826,61 +826,38 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
return sections;
}
+/*!
+ Search the \a tree for a node named \a target
+ */
const Node *CppCodeMarker::resolveTarget(const QString& target,
const Tree* tree,
const Node* relative,
const Node* self)
{
+ const Node* node = 0;
if (target.endsWith("()")) {
- const FunctionNode *func;
QString funcName = target;
funcName.chop(2);
-
QStringList path = funcName.split("::");
- if ((func = tree->findFunctionNode(path,
- relative,
- Tree::SearchBaseClasses))
- && func->metaness() != FunctionNode::MacroWithoutParams)
- return func;
+ const FunctionNode* fn = tree->findFunctionNode(path, relative, Tree::SearchBaseClasses);
+ if (fn) {
+ /*
+ Why is this case not accepted?
+ */
+ if (fn->metaness() != FunctionNode::MacroWithoutParams)
+ node = fn;
+ }
}
else if (target.contains(QLatin1Char('#'))) {
- // ### this doesn't belong here; get rid of TargetNode hack
- int hashAt = target.indexOf(QLatin1Char('#'));
- QString link = target.left(hashAt);
- QString ref = target.mid(hashAt + 1);
- const Node *node;
- if (link.isEmpty()) {
- node = relative;
- }
- else {
- QStringList path(link);
- node = tree->findNode(path, tree->root(), Tree::SearchBaseClasses);
- }
- if (node && node->isInnerNode()) {
- const Atom *atom = node->doc().body().firstAtom();
- while (atom) {
- if (atom->type() == Atom::Target && atom->string() == ref) {
- Node *parentNode = const_cast<Node *>(node);
- return new TargetNode(static_cast<InnerNode*>(parentNode),
- ref);
- }
- atom = atom->next();
- }
- }
+ // This error message is never printed; I think we can remove the case.
+ qDebug() << "qdoc: target case not handled:" << target;
}
else {
QStringList path = target.split("::");
- const Node *node;
- int flags = Tree::SearchBaseClasses |
- Tree::SearchEnumValues |
- Tree::NonFunction;
- if ((node = tree->findNode(path,
- relative,
- flags,
- self)))
- return node;
+ int flags = Tree::SearchBaseClasses | Tree::SearchEnumValues | Tree::NonFunction;
+ node = tree->findNode(path, relative, flags, self);
}
- return 0;
+ return node;
}
static const char * const typeTable[] = {