diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-10-22 16:41:53 +0200 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2020-10-23 07:54:11 +0200 |
commit | 72b5a4dcae9e9be4a6d66884d3cc0bfb2d692477 (patch) | |
tree | 4f960bbd34d4a299f3aa1cb986cb59dadba01c95 | |
parent | ffedf9cf7e6c52d8b59af47b21e7a29ee23720ec (diff) | |
download | qttools-72b5a4dcae9e9be4a6d66884d3cc0bfb2d692477.tar.gz |
qdoc: Fix broken links generated by \sincelist
The combination of single-exec mode and outputting to subdirectories
(offline mode) made \sincelist generate href's to new classes and
functions that are missing the target subdirectory.
This happened because we did not pass the relative node to the
function(s) that generate that list - proper link resolution
requires a check if the page containing the \sincelist command
comes from a different doc module, and the relative node is
used for that.
Fixes: QTBUG-87802
Change-Id: I30024d651a857b15375ef7e35dfaa21f0193ec46
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 15ebf3327191335c2c6eac4114ccb0553dc34f63)
-rw-r--r-- | src/qdoc/htmlgenerator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index b99c30224..a554f1ac4 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -732,9 +732,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark out() << "<a name=\"" << Doc::canonicalTitle(section.title()) << "\"></a>\n"; out() << "<h3>" << protectEnc(section.title()) << "</h3>\n"; if (idx == Sections::SinceClasses) - generateCompactList(Generic, nullptr, ncmap, false, QStringLiteral("Q")); + generateCompactList(Generic, relative, ncmap, false, QStringLiteral("Q")); else if (idx == Sections::SinceQmlTypes) - generateCompactList(Generic, nullptr, nqcmap, false, QStringLiteral("")); + generateCompactList(Generic, relative, nqcmap, false, QStringLiteral("")); else if (idx == Sections::SinceMemberFunctions) { ParentMaps parentmaps; ParentMaps::iterator pmap; @@ -750,17 +750,17 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark NodeVector nv = map->values().toVector(); out() << "<p>Class "; - out() << "<a href=\"" << linkForNode(map.key(), nullptr) << "\">"; + out() << "<a href=\"" << linkForNode(map.key(), relative) << "\">"; QStringList pieces = map.key()->fullName().split("::"); out() << protectEnc(pieces.last()); out() << "</a>" << ":</p>\n"; - generateSection(nv, nullptr, marker); + generateSection(nv, relative, marker); out() << "<br/>"; } } else { - generateSection(section.members(), nullptr, marker); + generateSection(section.members(), relative, marker); } } ++idx; |