forked from qt-creator/qt-creator
McuSupport: Implement support for parsing path type from json
The json kit files have an entry named "type" which is intended to specify whether a specific path points to a file or a directory (or something else). Until now, this entry has not been handled and all lineEdits expect a path, thus appearing red in the UI if supplied with a file. With this patch, support for the type "file" is added, with the possibility to support further types in parseLineEditType. Currently, only File and ExistingDirectory are supported, with the latter being used by default whenever no "type" entry is specified. Task-number: UL-6610 Change-Id: I252d4eff76d4a11b92ce55a0c0964446072e48c1 Reviewed-by: Daniele Bortolotti <daniele.bortolotti@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "settingshandler.h"
|
||||
|
||||
#include <utils/filepath.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
@@ -18,7 +19,6 @@ class ToolChain;
|
||||
}
|
||||
|
||||
namespace Utils {
|
||||
class PathChooser;
|
||||
class InfoLabel;
|
||||
class Id;
|
||||
} // namespace Utils
|
||||
@@ -30,17 +30,19 @@ class McuPackage : public McuAbstractPackage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
McuPackage(const SettingsHandler::Ptr &settingsHandler,
|
||||
const QString &label,
|
||||
const Utils::FilePath &defaultPath,
|
||||
const Utils::FilePath &detectionPath,
|
||||
const QString &settingsKey,
|
||||
const QString &cmakeVarName,
|
||||
const QString &envVarName,
|
||||
const QStringList &versions = {},
|
||||
const QString &downloadUrl = {},
|
||||
const McuPackageVersionDetector *versionDetector = nullptr,
|
||||
const bool addToPath = false);
|
||||
McuPackage(
|
||||
const SettingsHandler::Ptr &settingsHandler,
|
||||
const QString &label,
|
||||
const Utils::FilePath &defaultPath,
|
||||
const Utils::FilePath &detectionPath,
|
||||
const QString &settingsKey,
|
||||
const QString &cmakeVarName,
|
||||
const QString &envVarName,
|
||||
const QStringList &versions = {},
|
||||
const QString &downloadUrl = {},
|
||||
const McuPackageVersionDetector *versionDetector = nullptr,
|
||||
const bool addToPath = false,
|
||||
const Utils::PathChooser::Kind &valueType = Utils::PathChooser::Kind::ExistingDirectory);
|
||||
|
||||
~McuPackage() override = default;
|
||||
|
||||
@@ -90,6 +92,7 @@ private:
|
||||
const QString m_environmentVariableName;
|
||||
const QString m_downloadUrl;
|
||||
const bool m_addToSystemPath;
|
||||
const Utils::PathChooser::Kind m_valueType;
|
||||
|
||||
Status m_status = Status::InvalidPath;
|
||||
}; // class McuPackage
|
||||
|
||||
Reference in New Issue
Block a user