forked from qt-creator/qt-creator
Move examples manifest parser in separate function
and file. To make it auto-testable.
Change-Id: I19d263bf080a0089eb9a4ec0f379c52446771c0a
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit 7e75097447)
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
38
src/plugins/qtsupport/examplesparser.h
Normal file
38
src/plugins/qtsupport/examplesparser.h
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/welcomepagehelper.h>
|
||||
#include <utils/expected.h>
|
||||
|
||||
namespace QtSupport::Internal {
|
||||
|
||||
enum InstructionalType { Example = 0, Demo, Tutorial };
|
||||
|
||||
class ExampleItem : public Core::ListItem
|
||||
{
|
||||
public:
|
||||
QString projectPath;
|
||||
QString docUrl;
|
||||
QStringList filesToOpen;
|
||||
QString mainFile; /* file to be visible after opening filesToOpen */
|
||||
QStringList dependencies;
|
||||
InstructionalType type;
|
||||
int difficulty = 0;
|
||||
bool hasSourceCode = false;
|
||||
bool isVideo = false;
|
||||
bool isHighlighted = false;
|
||||
QString videoUrl;
|
||||
QString videoLength;
|
||||
QStringList platforms;
|
||||
};
|
||||
|
||||
Utils::expected_str<QList<ExampleItem *>> parseExamples(const QString &manifest,
|
||||
const QString &examplesInstallPath,
|
||||
const QString &demosInstallPath,
|
||||
bool examples);
|
||||
|
||||
} // namespace QtSupport::Internal
|
||||
|
||||
Q_DECLARE_METATYPE(QtSupport::Internal::ExampleItem *)
|
||||
Reference in New Issue
Block a user