diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index e09decc6662..d64d0714210 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -138,8 +138,6 @@ public: Utils::SynchronizedValue sshParameters; PortList freePorts; - FilePath debugServerPath; - FilePath qmlRunCommand; bool emptyCommandAllowed = false; QList 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 { if (old == newValue) @@ -512,9 +514,6 @@ void IDevice::fromMap(const Store &map) d->machineType = static_cast(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); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 7bdb347a89e..62e39840e41 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -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; diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp index f89767de0a3..23d25bfe8d5 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp @@ -217,12 +217,12 @@ void GenericLinuxDeviceConfigurationWidget::keyFileEditingFinished() void GenericLinuxDeviceConfigurationWidget::gdbServerEditingFinished() { - device()->setDebugServerPath(m_gdbServerLineEdit->filePath()); + device()->debugServerPath.setValue(m_gdbServerLineEdit->filePath()); } void GenericLinuxDeviceConfigurationWidget::qmlRuntimeEditingFinished() { - device()->setQmlRunCommand(m_qmlRuntimeLineEdit->filePath()); + device()->qmlRunCommand.setValue(m_qmlRuntimeLineEdit->filePath()); } void GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged()