forked from qt-creator/qt-creator
ProjectExplorer: Use FilePathAspect for IDevice::debugServerPath
... and IDevice::qmlRunCommand, currently for storage only. Leave the GUI side as-is for now, as this synchronizes the widget content with the local copy of the device data to allow the device tester to be run with the visible data. Change-Id: Ie8fb967c9a7f8246eec71d52c9b714ca3b3f5acd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -138,8 +138,6 @@ public:
|
||||
Utils::SynchronizedValue<SshParameters> sshParameters;
|
||||
|
||||
PortList freePorts;
|
||||
FilePath debugServerPath;
|
||||
FilePath qmlRunCommand;
|
||||
bool emptyCommandAllowed = false;
|
||||
|
||||
QList<Icon> deviceIcons;
|
||||
@@ -160,6 +158,10 @@ IDevice::IDevice()
|
||||
displayName.setSettingsKey(DisplayNameKey);
|
||||
displayName.setDisplayStyle(StringAspect::DisplayStyle::LineEditDisplay);
|
||||
|
||||
debugServerPath.setSettingsKey(DebugServerKey);
|
||||
|
||||
qmlRunCommand.setSettingsKey(QmlRuntimeKey);
|
||||
|
||||
auto validateDisplayName = [](const QString &old,
|
||||
const QString &newValue) -> expected_str<void> {
|
||||
if (old == newValue)
|
||||
@@ -512,9 +514,6 @@ void IDevice::fromMap(const Store &map)
|
||||
d->machineType = static_cast<MachineType>(map.value(MachineTypeKey, DefaultMachineType).toInt());
|
||||
d->version = map.value(VersionKey, 0).toInt();
|
||||
|
||||
d->debugServerPath = FilePath::fromSettings(map.value(DebugServerKey));
|
||||
const FilePath qmlRunCmd = FilePath::fromSettings(map.value(QmlRuntimeKey));
|
||||
d->qmlRunCommand = qmlRunCmd;
|
||||
d->extraData = storeFromVariant(map.value(ExtraDataKey));
|
||||
}
|
||||
|
||||
@@ -548,9 +547,6 @@ void IDevice::toMap(Store &map) const
|
||||
map.insert(PortsSpecKey, d->freePorts.toString());
|
||||
map.insert(VersionKey, d->version);
|
||||
|
||||
map.insert(DebugServerKey, d->debugServerPath.toSettings());
|
||||
map.insert(QmlRuntimeKey, d->qmlRunCommand.toSettings());
|
||||
|
||||
map.insert(ExtraDataKey, variantFromStore(d->extraData));
|
||||
}
|
||||
|
||||
@@ -635,26 +631,6 @@ FilePath IDevice::rootPath() const
|
||||
return FilePath::fromParts(u"device", id().toString(), u"/");
|
||||
}
|
||||
|
||||
FilePath IDevice::debugServerPath() const
|
||||
{
|
||||
return d->debugServerPath;
|
||||
}
|
||||
|
||||
void IDevice::setDebugServerPath(const FilePath &path)
|
||||
{
|
||||
d->debugServerPath = path;
|
||||
}
|
||||
|
||||
FilePath IDevice::qmlRunCommand() const
|
||||
{
|
||||
return d->qmlRunCommand;
|
||||
}
|
||||
|
||||
void IDevice::setQmlRunCommand(const FilePath &path)
|
||||
{
|
||||
d->qmlRunCommand = path;
|
||||
}
|
||||
|
||||
void IDevice::setExtraData(Id kind, const QVariant &data)
|
||||
{
|
||||
d->extraData.insert(keyFromString(kind.toString()), data);
|
||||
|
||||
@@ -173,11 +173,8 @@ public:
|
||||
virtual Utils::FilePath rootPath() const;
|
||||
virtual Utils::FilePath filePath(const QString &pathOnDevice) const;
|
||||
|
||||
Utils::FilePath debugServerPath() const;
|
||||
void setDebugServerPath(const Utils::FilePath &path);
|
||||
|
||||
Utils::FilePath qmlRunCommand() const;
|
||||
void setQmlRunCommand(const Utils::FilePath &path);
|
||||
Utils::FilePathAspect debugServerPath{this};
|
||||
Utils::FilePathAspect qmlRunCommand{this};
|
||||
|
||||
void setExtraData(Utils::Id kind, const QVariant &data);
|
||||
QVariant extraData(Utils::Id kind) const;
|
||||
|
||||
Reference in New Issue
Block a user