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 19:52:18 +0200
commitd6956594547ee7bc842ab306211a02fbc377567d (patch)
treec36bed75309f4bd4aab521ee338c710be8e0384b
parenta5d5f2a4a23201cd8bdd4c1adc6240f71ba46e6d (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. 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) (cherry picked from commit bdb18ec1bde8b7cea2c09166b8d2c609602a2336)
-rw-r--r--src/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/generator.cpp b/src/qdoc/generator.cpp
index 5da779781..56976020c 100644
--- a/src/qdoc/generator.cpp
+++ b/src/qdoc/generator.cpp
@@ -312,8 +312,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 c62e6ef70..c62e6ef70 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 195cf78ea..44210e0ab 100644
--- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
+++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
@@ -539,8 +539,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");
}
int main(int argc, char *argv[])