Convert Examples model to FilePath

Change-Id: I56219d2f9516662b32d45fd9b2108a0ad34113cc
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit 255afd45bf)
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2023-02-22 10:17:19 +01:00
parent e6e9405cc9
commit ac17e0e2ad
5 changed files with 101 additions and 107 deletions

View File

@@ -5,6 +5,7 @@
#include <coreplugin/welcomepagehelper.h>
#include <utils/expected.h>
#include <utils/filepath.h>
namespace QtSupport::Internal {
@@ -13,11 +14,11 @@ enum InstructionalType { Example = 0, Demo, Tutorial };
class ExampleItem : public Core::ListItem
{
public:
QString projectPath;
Utils::FilePath projectPath;
QString docUrl;
QStringList filesToOpen;
QString mainFile; /* file to be visible after opening filesToOpen */
QStringList dependencies;
Utils::FilePaths filesToOpen;
Utils::FilePath mainFile; /* file to be visible after opening filesToOpen */
Utils::FilePaths dependencies;
InstructionalType type;
int difficulty = 0;
bool hasSourceCode = false;
@@ -28,9 +29,9 @@ public:
QStringList platforms;
};
Utils::expected_str<QList<ExampleItem *>> parseExamples(const QString &manifest,
const QString &examplesInstallPath,
const QString &demosInstallPath,
Utils::expected_str<QList<ExampleItem *>> parseExamples(const Utils::FilePath &manifest,
const Utils::FilePath &examplesInstallPath,
const Utils::FilePath &demosInstallPath,
bool examples);
} // namespace QtSupport::Internal