diff options
7 files changed, 17 insertions, 36 deletions
diff --git a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc index 2b317d9e7..16d7da116 100644 --- a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc +++ b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc @@ -1958,10 +1958,9 @@ \title Example Manifest Files - QDoc generates XML files that contain information about all documented - examples and demos. These files, named \c {examples-manifest.xml} and - \c {demos-manifest.xml}, are used by Qt Creator to present a list of - examples in its welcome screen and to link to their documentation. + QDoc generates example-manifest.xml files that contain information about + all documented examples. These files are used by Qt Creator to present a + list of examples in its welcome screen and to link to their documentation. \section1 Manifest XML Structure diff --git a/src/qdoc/manifestwriter.cpp b/src/qdoc/manifestwriter.cpp index 0a19efc63..4438f4c4a 100644 --- a/src/qdoc/manifestwriter.cpp +++ b/src/qdoc/manifestwriter.cpp @@ -160,8 +160,7 @@ void ManifestWriter::processManifestMetaContent(const QString &fullName, F match */ void ManifestWriter::generateManifestFiles() { - generateManifestFile("examples", "example"); - generateManifestFile("demos", "demo"); + generateExampleManifestFile(); m_qdb->exampleNodeMap().clear(); m_manifestMetaContent.clear(); } @@ -221,24 +220,16 @@ static void writeTagsElement(QXmlStreamWriter *writer, const QSet<QString> &tags } /*! - This function is called by generateManifestFiles(), once - for each manifest file to be generated. \a manifest is the - type of manifest file. + This function is called by generateExampleManifestFiles(), once + for each manifest file to be generated. */ -void ManifestWriter::generateManifestFile(const QString &manifest, const QString &element) +void ManifestWriter::generateExampleManifestFile() { const ExampleNodeMap &exampleNodeMap = m_qdb->exampleNodeMap(); if (exampleNodeMap.isEmpty()) return; - bool demos = (manifest == QLatin1String("demos")); - if (!std::any_of(exampleNodeMap.cbegin(), exampleNodeMap.cend(), - [demos](const ExampleNode *en) { - return demos == en->name().startsWith("demos"); - })) - return; - - const QString outputFileName = manifest + "-manifest.xml"; + const QString outputFileName = "examples-manifest.xml"; QFile outputFile(m_outputDirectory + QLatin1Char('/') + outputFileName); if (!outputFile.open(QFile::WriteOnly | QFile::Text)) return; @@ -248,13 +239,11 @@ void ManifestWriter::generateManifestFile(const QString &manifest, const QString writer.writeStartDocument(); writer.writeStartElement("instructionals"); writer.writeAttribute("module", m_project); - writer.writeStartElement(manifest); + writer.writeStartElement("examples"); for (const auto &example : exampleNodeMap.values()) { QMap<QString, QString> usedAttributes; QSet<QString> tags; - if (demos != example->name().startsWith("demos")) - continue; const QString installPath = retrieveExampleInstallationPath(example); const QString fullName = m_project + QLatin1Char('/') + example->title(); @@ -287,8 +276,7 @@ void ManifestWriter::generateManifestFile(const QString &manifest, const QString } }); - // write the example/demo element - writer.writeStartElement(element); + writer.writeStartElement("example"); for (auto it = usedAttributes.cbegin(); it != usedAttributes.cend(); ++it) writer.writeAttribute(it.key(), it.value()); @@ -305,7 +293,7 @@ void ManifestWriter::generateManifestFile(const QString &manifest, const QString const QMap<int, QString> filesToOpen = getFilesToOpen(files, exampleName); writeFilesToOpen(writer, installPath, filesToOpen); - writer.writeEndElement(); // example/demo + writer.writeEndElement(); // example } writer.writeEndElement(); // examples diff --git a/src/qdoc/manifestwriter.h b/src/qdoc/manifestwriter.h index ea174cb95..e703f74e0 100644 --- a/src/qdoc/manifestwriter.h +++ b/src/qdoc/manifestwriter.h @@ -24,7 +24,7 @@ class ManifestWriter public: ManifestWriter(); void generateManifestFiles(); - void generateManifestFile(const QString &manifest, const QString &element); + void generateExampleManifestFile(); void readManifestMetaContent(); QString retrieveExampleInstallationPath(const ExampleNode *example) const; diff --git a/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml b/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml deleted file mode 100644 index 5cbdf3f62..000000000 --- a/tests/auto/qdoc/generatedoutput/expected_output/demos-manifest.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<instructionals module="Test"> - <demos> - <demo docUrl="qthelp://org.qt-project.test.001/test/test-demos-demo-example.html" imageUrl="qthelp://org.qt-project.test.001/test/images/leonardo-da-vinci.png" isTest="true" name="Demo" projectPath="test/demos/demo/demo.pro"> - <description><![CDATA[No description available]]></description> - <tags>test</tags> - </demo> - </demos> -</instructionals> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml index bbce463eb..89a4f0553 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml @@ -6,6 +6,10 @@ <tags>test</tags> <fileToOpen mainFile="true">test/cmaketest/main.cpp</fileToOpen> </example> + <example docUrl="qthelp://org.qt-project.test.001/test/test-demos-demo-example.html" imageUrl="qthelp://org.qt-project.test.001/test/images/leonardo-da-vinci.png" isTest="true" name="Demo" projectPath="test/demos/demo/demo.pro"> + <description><![CDATA[No description available]]></description> + <tags>test</tags> + </example> <example docUrl="qthelp://org.qt-project.test.001/test/test-componentset-example.html" isTest="true" name="QML Documentation Example" projectPath="tutorials/componentset/componentset.pro"> <description><![CDATA[Example for documenting QML types.]]></description> <tags>sample,test</tags> diff --git a/tests/auto/qdoc/generatedoutput/testdata/examples/demos/hidden/doc/src/hidden.qdoc b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/hidden/doc/src/hidden.qdoc index 2b5d64123..dddcbc074 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/examples/demos/hidden/doc/src/hidden.qdoc +++ b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/hidden/doc/src/hidden.qdoc @@ -5,7 +5,7 @@ \example demos/hidden \title Hidden Demo \meta tag broken - \brief Tagged 'broken', does not appear in demos-manifest.xml. + \brief Tagged 'broken', does not appear in examples-manifest.xml. Also missing an image, but that's OK as it's broken anyway. */ diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index d45750476..5c013639a 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -352,7 +352,6 @@ void tst_generatedOutput::examplesManifestXmlAndQhp() { testAndCompare("testdata/configs/examples-qhp.qdocconf", "examples-manifest.xml " - "demos-manifest.xml " "test.qhp"); } |