summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/qdocdatabase.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2013-06-10 13:54:11 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-11 14:33:00 +0200
commit505a10baf76dc9cc10432d62205dc352bd6cefbe (patch)
tree7bc7f8e7b989e816faab336429d87c9894797e8f /src/tools/qdoc/qdocdatabase.cpp
parent0d7d53fd46e8ab512bed88d0dab114cfada227ce (diff)
qdoc: qdoc was confused by namespace and module with same name
When qdoc searched for QtConncurrent::blockingFilter(), it found the module node for QtConcurrent instead of the namespace. This was because qdoc wasn't given specific enough instructions on how to perform the search. Now it searches for the namespace first, then the C++ class, then the module. Task-number: QTBUG-31535 Change-Id: I4f8aec503903508789738f2a77c76f47a3e80a93 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/tools/qdoc/qdocdatabase.cpp')
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index 674917f6dc..7a3df4e4f2 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -1126,4 +1126,56 @@ QString QDocDatabase::refForAtom(const Atom* atom)
return QString();
}
+/*!
+ If there are open namespaces, search for the function node
+ having the same function name as the \a clone node in each
+ open namespace. The \a parentPath is a portion of the path
+ name provided with the function name at the point of
+ reference. \a parentPath is usually a class name. Return
+ the pointer to the function node if one is found in an
+ open namespace. Otherwise return 0.
+
+ This open namespace concept is of dubious value and might
+ be removed.
+ */
+FunctionNode* QDocDatabase::findNodeInOpenNamespace(const QStringList& parentPath,
+ const FunctionNode* clone)
+{
+ FunctionNode* fn = 0;
+ if (!openNamespaces_.isEmpty()) {
+ foreach (const QString& t, openNamespaces_) {
+ QStringList path = t.split("::") + parentPath;
+ fn = findFunctionNode(path, clone);
+ if (fn)
+ break;
+ }
+ }
+ return fn;
+}
+
+/*!
+ Find a node of the specified \a type and \a subtype that is
+ reached with the specified \a path. If such a node is found
+ in an open namespace, prefix \a path with the name of the
+ open namespace and "::" and return a pointer to the node.
+ Othewrwise return 0.
+ */
+Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path,
+ Node::Type type,
+ Node::SubType subtype)
+{
+ Node* n = 0;
+ if (!openNamespaces_.isEmpty()) {
+ foreach (const QString& t, openNamespaces_) {
+ QStringList p = t.split("::") + path;
+ n = findNodeByNameAndType(p, type, subtype);
+ if (n) {
+ path = p;
+ break;
+ }
+ }
+ }
+ return n;
+}
+
QT_END_NAMESPACE