Examples: Fix reading the category ordering from manifest

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 08bbe885b4

Change-Id: I9148cc9f1060500f46be2bbc9c9ef6c2512c2f6c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
This commit is contained in:
Eike Ziller
2024-01-05 15:27:45 +01:00
parent 7a46bbe667
commit c07b453486
2 changed files with 10 additions and 5 deletions

View File

@@ -363,7 +363,8 @@ void ExamplesViewController::updateExamples()
const QStringList sources = m_exampleSetModel->exampleSources(&examplesInstallPath, const QStringList sources = m_exampleSetModel->exampleSources(&examplesInstallPath,
&demosInstallPath, &demosInstallPath,
&qtVersion); &qtVersion,
m_isExamples);
QStringList categoryOrder; QStringList categoryOrder;
QList<ExampleItem *> items; QList<ExampleItem *> items;
for (const QString &exampleSource : sources) { for (const QString &exampleSource : sources) {
@@ -493,12 +494,15 @@ QtVersion *ExampleSetModel::findHighestQtVersion(const QtVersions &versions) con
QStringList ExampleSetModel::exampleSources(QString *examplesInstallPath, QStringList ExampleSetModel::exampleSources(QString *examplesInstallPath,
QString *demosInstallPath, QString *demosInstallPath,
QVersionNumber *qtVersion) QVersionNumber *qtVersion,
bool isExamples)
{ {
QStringList sources; QStringList sources;
// Qt Creator shipped tutorials if (!isExamples) {
sources << ":/qtsupport/qtcreator_tutorials.xml"; // Qt Creator shipped tutorials
sources << ":/qtsupport/qtcreator_tutorials.xml";
}
QString examplesPath; QString examplesPath;
QString demosPath; QString demosPath;

View File

@@ -41,7 +41,8 @@ public:
bool selectExampleSet(int index); bool selectExampleSet(int index);
QStringList exampleSources(QString *examplesInstallPath, QStringList exampleSources(QString *examplesInstallPath,
QString *demosInstallPath, QString *demosInstallPath,
QVersionNumber *qtVersion); QVersionNumber *qtVersion,
bool isExamples);
bool selectedQtSupports(const Utils::Id &target) const; bool selectedQtSupports(const Utils::Id &target) const;
signals: signals: