summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2023-09-25 13:36:55 +0000
committerPaul Wicking <paul.wicking@qt.io>2023-09-30 10:14:27 +0200
commitbdb18ec1bde8b7cea2c09166b8d2c609602a2336 (patch)
tree1549a34eace798b09699965ef892a921fa78b5e3
parente5912919ab571908c3ba7f11ddbd08cdf1b06fab (diff)
qdoc: Qualify proxy pages with the module name
When QDoc parses a \relates command, it tries to associate the topic to another aggregate (class, namespace, or header). If this aggregate doesn't exist, a proxy page is generated for the aggregate. These proxy pages act as the output location for the documentation of related non-members that live in a module different to where the actual aggregate is documented. The reference of the actual aggregate will then list the related non-members, linking to the proxy page(s). However, the filename of the proxy page was not qualified with the name of the module; if there were more than one proxy page generated for a single aggregate (because topics in multiple modules try to relate to it), then the proxy pages end up being overwritten in online documentation where QDoc uses a flat output directory structure. Pick-to: 6.5 Fixes: QTBUG-117510 Change-Id: I4a8b14fe7129ae885b5d2a440b51eee4ee35035f Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Luca Di Sera <luca.disera@qt.io> (cherry picked from commit 5f91518265e7f818be7f7c77ef1d18a24ca52bb8)
-rw-r--r--src/qdoc/qdoc/generator.cpp3
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/proxypage-docbook/stdpair-proxypage-proxy.xml (renamed from tests/auto/qdoc/generatedoutput/expected_output/proxypage-docbook/stdpair-proxy.xml)0
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/proxypage/stdpair-proxypage-proxy.html (renamed from tests/auto/qdoc/generatedoutput/expected_output/proxypage/stdpair-proxy.html)2
-rw-r--r--tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp4
4 files changed, 4 insertions, 5 deletions
diff --git a/src/qdoc/qdoc/generator.cpp b/src/qdoc/qdoc/generator.cpp
index a3d20a9bb..3bac3e961 100644
--- a/src/qdoc/qdoc/generator.cpp
+++ b/src/qdoc/qdoc/generator.cpp
@@ -285,8 +285,7 @@ QString Generator::fileBase(const Node *node) const
base.prepend(outputPrefix(node));
} else if (node->isProxyNode()) {
- base = node->name();
- base.append("-proxy");
+ base.append("%1-%2-proxy"_L1.arg(node->name(), node->tree()->physicalModuleName()));
} else {
const Node *p = node;
forever {
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/proxypage-docbook/stdpair-proxy.xml b/tests/auto/qdoc/generatedoutput/expected_output/proxypage-docbook/stdpair-proxypage-proxy.xml
index 7dbbc54c1..7dbbc54c1 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/proxypage-docbook/stdpair-proxy.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/proxypage-docbook/stdpair-proxypage-proxy.xml
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/proxypage/stdpair-proxy.html b/tests/auto/qdoc/generatedoutput/expected_output/proxypage/stdpair-proxypage-proxy.html
index 5b542adb4..7ebc69138 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/proxypage/stdpair-proxy.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/proxypage/stdpair-proxypage-proxy.html
@@ -8,7 +8,7 @@
<h1 class="title">StdPair Proxy Page</h1>
<h2 id="types">Types</h2>
<div class="table"><table class="alignedsummary" translate="no">
-<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="stdpair-proxy.html#StdPair-typedef" translate="no">StdPair</a></b></td></tr>
+<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="stdpair-proxypage-proxy.html#StdPair-typedef" translate="no">StdPair</a></b></td></tr>
</table></div>
<div class="types">
<h2>Type Documentation</h2>
diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
index d50ccace5..9f0e5e318 100644
--- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
+++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
@@ -589,8 +589,8 @@ void tst_generatedOutput::testGlobalFunctions()
void tst_generatedOutput::proxyPage()
{
testAndCompare("testdata/proxypage/proxypage.qdocconf",
- "proxypage/stdpair-proxy.html "
- "proxypage-docbook/stdpair-proxy.xml");
+ "proxypage/stdpair-proxypage-proxy.html "
+ "proxypage-docbook/stdpair-proxypage-proxy.xml");
}
void tst_generatedOutput::nonAsciiCharacterInput()