From a8c609c005d7ae3f4acbe2d1895743ba3232f21b Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Fri, 7 Apr 2023 21:24:40 +0200 Subject: QDoc: Don't write type attributes to index files for macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QDoc includes a number of attributes when generating index files. Internally, QDoc uses the `FunctionNode` data structure to represent invokables. This data structure includes the return type for the function or method such a node represents. However, not all invokable entities that are represented internally as a `FunctionNode` carry a return value. This applies in particular to preprocessor macros in C and C++. When generating the index files. QDoc writes an empty `type=""` attribute for `FunctionNode`s that represent a macro. When reading the values back in, the value for the `type` attribute defaults to empty is the attribute is missing. Therefore, writing this out in the first place leads to unnecessary clutter in the index files. This change modifies QDoc's behavior such that these attributes are only written to the index file if they exist. Test data for the `generatedOutput` test is updated to reflect the new content of the index files covered by that test. Task-number: QTBUG-112494 Change-Id: Id6e3a730cbde098068029af1ebf9fa17bd2a4441 Reviewed-by: Topi Reiniƶ --- .../generatedoutput/expected_output/html/testqdoc-test.webxml | 4 ++-- .../generatedoutput/expected_output/properties/testcpp.index | 10 +++++----- tests/auto/qdoc/generatedoutput/expected_output/testcpp.index | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml index 565122053..db82eb7e8 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml @@ -5,13 +5,13 @@ A class in a namespace. - + A macro with argument x. - + Default constructor. diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index index b9da9fd42..a06a13ae7 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index +++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index @@ -2,8 +2,8 @@ - - + + @@ -20,12 +20,12 @@ - + - + - + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index index 1fe7eacfa..0808f8a5e 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index +++ b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index @@ -2,8 +2,8 @@ - - + + @@ -19,12 +19,12 @@ - + - + - + -- cgit v1.2.1