From 8a79e4d6784766d03aca50ebdfdf1c9175298326 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 4 Sep 2015 11:55:04 +0200 Subject: [PATCH] qdoc: Fix issue with findNodeForTarget() QDoc was searching for nodes using empty target string in some cases (when the string contained no '::' but genus was set to either QML or CPP). This resulted in random nodes being returned from findUnambiguousTarget(), causing mislinking without any warnings. Change-Id: I1bd434ec7470580cf5cb8083c2b74c37ef562473 Reviewed-by: Martin Smith --- src/tools/qdoc/tree.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index d64903e61ed..f8f88e6b91a 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -721,12 +721,8 @@ const Node* Tree::findNodeForTarget(const QStringList& path, QString& ref) const { const Node* node = 0; - QString p; - if (path.size() > 1) - p = path.join(QString("::")); - else if ((genus == Node::DontCare) || (genus == Node::DOC)) { - p = path.at(0); - node = findDocumentNodeByTitle(p); + if ((genus == Node::DontCare) || (genus == Node::DOC)) { + node = findDocumentNodeByTitle(path.at(0)); if (node) { if (!target.isEmpty()) { ref = getRef(target, node); @@ -737,7 +733,8 @@ const Node* Tree::findNodeForTarget(const QStringList& path, return node; } } - node = findUnambiguousTarget(p, ref); + + node = findUnambiguousTarget(path.join(QStringLiteral("::")), ref); if (node) { if (!target.isEmpty()) { ref = getRef(target, node);