From 03b05d85794235c5d82d75e079f0254245570695 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 11 Aug 2021 06:35:40 +0200 Subject: [PATCH] ProjectExplorer: FilePathify IDevice::debugServerPath Change-Id: Ic7e5ba0ac5ff4fa2605f1e479e914cd85623c9da Reviewed-by: Christian Stenger --- src/plugins/debugger/debuggerruncontrol.cpp | 2 +- src/plugins/projectexplorer/devicesupport/idevice.cpp | 10 +++++----- src/plugins/projectexplorer/devicesupport/idevice.h | 4 ++-- .../genericlinuxdeviceconfigurationwidget.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index c9a9a526874..6c7cbe1ddbe 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1036,7 +1036,7 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat if (isQmlDebugging && !isCppDebugging) { debugServer.command.setExecutable(mainRunnable.command.executable()); // FIXME: Case should not happen? } else { - debugServer.command.setExecutable(FilePath::fromString(runControl->device()->debugServerPath())); + debugServer.command.setExecutable(runControl->device()->debugServerPath()); if (debugServer.command.isEmpty()) debugServer.command.setExecutable("gdbserver"); args.clear(); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index f897f3e70b8..547157c9ec3 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -152,7 +152,7 @@ public: QSsh::SshConnectionParameters sshParameters; Utils::PortList freePorts; - QString debugServerPath; + Utils::FilePath debugServerPath; QString qmlRunCommand; bool emptyCommandAllowed = false; @@ -615,7 +615,7 @@ void IDevice::fromMap(const QVariantMap &map) d->machineType = static_cast(map.value(QLatin1String(MachineTypeKey), DefaultMachineType).toInt()); d->version = map.value(QLatin1String(VersionKey), 0).toInt(); - d->debugServerPath = map.value(QLatin1String(DebugServerKey)).toString(); + d->debugServerPath = FilePath::fromVariant(map.value(QLatin1String(DebugServerKey))); d->qmlRunCommand = map.value(QLatin1String(QmlRuntimeKey)).toString(); d->extraData = map.value(ExtraDataKey).toMap(); } @@ -646,7 +646,7 @@ QVariantMap IDevice::toMap() const map.insert(QLatin1String(PortsSpecKey), d->freePorts.toString()); map.insert(QLatin1String(VersionKey), d->version); - map.insert(QLatin1String(DebugServerKey), d->debugServerPath); + map.insert(QLatin1String(DebugServerKey), d->debugServerPath.toVariant()); map.insert(QLatin1String(QmlRuntimeKey), d->qmlRunCommand); map.insert(ExtraDataKey, d->extraData); @@ -720,12 +720,12 @@ void IDevice::setMachineType(MachineType machineType) d->machineType = machineType; } -QString IDevice::debugServerPath() const +FilePath IDevice::debugServerPath() const { return d->debugServerPath; } -void IDevice::setDebugServerPath(const QString &path) +void IDevice::setDebugServerPath(const FilePath &path) { d->debugServerPath = path; } diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index be4e9e358cb..68a19f60273 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -211,8 +211,8 @@ public: MachineType machineType() const; void setMachineType(MachineType machineType); - QString debugServerPath() const; - void setDebugServerPath(const QString &path); + Utils::FilePath debugServerPath() const; + void setDebugServerPath(const Utils::FilePath &path); QString qmlRunCommand() const; void setQmlRunCommand(const QString &path); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp index 74dbe099a07..9db81d1270c 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp @@ -129,7 +129,7 @@ void GenericLinuxDeviceConfigurationWidget::keyFileEditingFinished() void GenericLinuxDeviceConfigurationWidget::gdbServerEditingFinished() { - device()->setDebugServerPath(m_ui->gdbServerLineEdit->text()); + device()->setDebugServerPath(FilePath::fromString(m_ui->gdbServerLineEdit->text())); } void GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged() @@ -212,6 +212,6 @@ void GenericLinuxDeviceConfigurationWidget::initGui() m_ui->timeoutSpinBox->setValue(sshParams.timeout); m_ui->userLineEdit->setText(sshParams.userName()); m_ui->keyFileLineEdit->setPath(sshParams.privateKeyFile); - m_ui->gdbServerLineEdit->setText(device()->debugServerPath()); + m_ui->gdbServerLineEdit->setText(device()->debugServerPath().toString()); updatePortsWarningLabel(); }