summaryrefslogtreecommitdiff
path: root/src/qdoc/xmlgenerator.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2021-03-11 13:32:13 +0100
committerTopi Reinio <topi.reinio@qt.io>2021-03-22 10:18:32 +0100
commit10268e3e9c5f47db8231f2ac907a46cf9283d365 (patch)
treeccfa72e90a0bf30dbfcfa1f0ba835afad49be4dc /src/qdoc/xmlgenerator.cpp
parentccd9f4eb9b8200fa26f32ffacae6ae93619ca867 (diff)
downloadqttools-10268e3e9c5f47db8231f2ac907a46cf9283d365.tar.gz
qdoc: Stop auto-linking to section titles
The purpose of the auto-linking feature is to link strings in the text that resemble class or function names to API reference. However, QDoc did not discriminate between the types of the resolved link targets. Therefore, writing \section1 QString on a random \page would potentially redirect all autolinks to QString to that section. To fix, turn Node::Genus into attributes so we can do bitwise operations on the genus, and introduce Node::API that includes all API reference node genera. Node::API is not assigned to nodes directly, but is used in searches to match against any API reference nodes. Pick-to: 6.0 6.1 Task-number: QTBUG-91141 Change-Id: Ic0a22b7105e1278662f5ae7d4132980200638225 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/xmlgenerator.cpp')
-rw-r--r--src/qdoc/xmlgenerator.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qdoc/xmlgenerator.cpp b/src/qdoc/xmlgenerator.cpp
index d161e5693..e5d879e5e 100644
--- a/src/qdoc/xmlgenerator.cpp
+++ b/src/qdoc/xmlgenerator.cpp
@@ -405,11 +405,12 @@ QString XmlGenerator::getLink(const Atom *atom, const Node *relative, const Node
to the node holding the qdoc comment where the link command
was found.
*/
-QString XmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const Node **node)
+QString XmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const Node **node,
+ Node::Genus genus)
{
QString ref;
- *node = m_qdb->findNodeForAtom(atom, relative, ref);
+ *node = m_qdb->findNodeForAtom(atom, relative, ref, genus);
if (!(*node))
return QString();