From c07b45348625454d9d0eb9e90d765290e0b7de09 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 5 Jan 2024 15:27:45 +0100 Subject: [PATCH] Examples: Fix reading the category ordering from manifest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtcreator_tutorials.xml contains ordering information for the tutorials, and if we read that (first) we ignore any subsequent ordering that the set of Qt examples defines (in qtdoc/examples-manifest.xml). Only read the tutorials.xml if we are actually interested in tutorials. Amends 08bbe885b49d6782178f0bc7b19c1bb162633666 Change-Id: I9148cc9f1060500f46be2bbc9c9ef6c2512c2f6c Reviewed-by: Reviewed-by: Christian Stenger Reviewed-by: Kai Köhne --- src/plugins/qtsupport/exampleslistmodel.cpp | 12 ++++++++---- src/plugins/qtsupport/exampleslistmodel.h | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 3d67706b77f..d8593cb1fd8 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -363,7 +363,8 @@ void ExamplesViewController::updateExamples() const QStringList sources = m_exampleSetModel->exampleSources(&examplesInstallPath, &demosInstallPath, - &qtVersion); + &qtVersion, + m_isExamples); QStringList categoryOrder; QList items; for (const QString &exampleSource : sources) { @@ -493,12 +494,15 @@ QtVersion *ExampleSetModel::findHighestQtVersion(const QtVersions &versions) con QStringList ExampleSetModel::exampleSources(QString *examplesInstallPath, QString *demosInstallPath, - QVersionNumber *qtVersion) + QVersionNumber *qtVersion, + bool isExamples) { QStringList sources; - // Qt Creator shipped tutorials - sources << ":/qtsupport/qtcreator_tutorials.xml"; + if (!isExamples) { + // Qt Creator shipped tutorials + sources << ":/qtsupport/qtcreator_tutorials.xml"; + } QString examplesPath; QString demosPath; diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index 142f1c72f6c..a54ac8bc7b7 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -41,7 +41,8 @@ public: bool selectExampleSet(int index); QStringList exampleSources(QString *examplesInstallPath, QString *demosInstallPath, - QVersionNumber *qtVersion); + QVersionNumber *qtVersion, + bool isExamples); bool selectedQtSupports(const Utils::Id &target) const; signals: