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 <martin.smith@digia.com>
This commit is contained in:
parent
9c6a49078a
commit
8a79e4d678
@ -721,12 +721,8 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
|
|||||||
QString& ref) const
|
QString& ref) const
|
||||||
{
|
{
|
||||||
const Node* node = 0;
|
const Node* node = 0;
|
||||||
QString p;
|
if ((genus == Node::DontCare) || (genus == Node::DOC)) {
|
||||||
if (path.size() > 1)
|
node = findDocumentNodeByTitle(path.at(0));
|
||||||
p = path.join(QString("::"));
|
|
||||||
else if ((genus == Node::DontCare) || (genus == Node::DOC)) {
|
|
||||||
p = path.at(0);
|
|
||||||
node = findDocumentNodeByTitle(p);
|
|
||||||
if (node) {
|
if (node) {
|
||||||
if (!target.isEmpty()) {
|
if (!target.isEmpty()) {
|
||||||
ref = getRef(target, node);
|
ref = getRef(target, node);
|
||||||
@ -737,7 +733,8 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
node = findUnambiguousTarget(p, ref);
|
|
||||||
|
node = findUnambiguousTarget(path.join(QStringLiteral("::")), ref);
|
||||||
if (node) {
|
if (node) {
|
||||||
if (!target.isEmpty()) {
|
if (!target.isEmpty()) {
|
||||||
ref = getRef(target, node);
|
ref = getRef(target, node);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user