ProjectExplorer: FilePathify IDevice::debugServerPath

Change-Id: Ic7e5ba0ac5ff4fa2605f1e479e914cd85623c9da
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-08-11 06:35:40 +02:00
parent 7c28c4f744
commit 03b05d8579
4 changed files with 10 additions and 10 deletions

View File

@@ -1036,7 +1036,7 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat
if (isQmlDebugging && !isCppDebugging) { if (isQmlDebugging && !isCppDebugging) {
debugServer.command.setExecutable(mainRunnable.command.executable()); // FIXME: Case should not happen? debugServer.command.setExecutable(mainRunnable.command.executable()); // FIXME: Case should not happen?
} else { } else {
debugServer.command.setExecutable(FilePath::fromString(runControl->device()->debugServerPath())); debugServer.command.setExecutable(runControl->device()->debugServerPath());
if (debugServer.command.isEmpty()) if (debugServer.command.isEmpty())
debugServer.command.setExecutable("gdbserver"); debugServer.command.setExecutable("gdbserver");
args.clear(); args.clear();

View File

@@ -152,7 +152,7 @@ public:
QSsh::SshConnectionParameters sshParameters; QSsh::SshConnectionParameters sshParameters;
Utils::PortList freePorts; Utils::PortList freePorts;
QString debugServerPath; Utils::FilePath debugServerPath;
QString qmlRunCommand; QString qmlRunCommand;
bool emptyCommandAllowed = false; bool emptyCommandAllowed = false;
@@ -615,7 +615,7 @@ void IDevice::fromMap(const QVariantMap &map)
d->machineType = static_cast<MachineType>(map.value(QLatin1String(MachineTypeKey), DefaultMachineType).toInt()); d->machineType = static_cast<MachineType>(map.value(QLatin1String(MachineTypeKey), DefaultMachineType).toInt());
d->version = map.value(QLatin1String(VersionKey), 0).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->qmlRunCommand = map.value(QLatin1String(QmlRuntimeKey)).toString();
d->extraData = map.value(ExtraDataKey).toMap(); d->extraData = map.value(ExtraDataKey).toMap();
} }
@@ -646,7 +646,7 @@ QVariantMap IDevice::toMap() const
map.insert(QLatin1String(PortsSpecKey), d->freePorts.toString()); map.insert(QLatin1String(PortsSpecKey), d->freePorts.toString());
map.insert(QLatin1String(VersionKey), d->version); 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(QLatin1String(QmlRuntimeKey), d->qmlRunCommand);
map.insert(ExtraDataKey, d->extraData); map.insert(ExtraDataKey, d->extraData);
@@ -720,12 +720,12 @@ void IDevice::setMachineType(MachineType machineType)
d->machineType = machineType; d->machineType = machineType;
} }
QString IDevice::debugServerPath() const FilePath IDevice::debugServerPath() const
{ {
return d->debugServerPath; return d->debugServerPath;
} }
void IDevice::setDebugServerPath(const QString &path) void IDevice::setDebugServerPath(const FilePath &path)
{ {
d->debugServerPath = path; d->debugServerPath = path;
} }

View File

@@ -211,8 +211,8 @@ public:
MachineType machineType() const; MachineType machineType() const;
void setMachineType(MachineType machineType); void setMachineType(MachineType machineType);
QString debugServerPath() const; Utils::FilePath debugServerPath() const;
void setDebugServerPath(const QString &path); void setDebugServerPath(const Utils::FilePath &path);
QString qmlRunCommand() const; QString qmlRunCommand() const;
void setQmlRunCommand(const QString &path); void setQmlRunCommand(const QString &path);

View File

@@ -129,7 +129,7 @@ void GenericLinuxDeviceConfigurationWidget::keyFileEditingFinished()
void GenericLinuxDeviceConfigurationWidget::gdbServerEditingFinished() void GenericLinuxDeviceConfigurationWidget::gdbServerEditingFinished()
{ {
device()->setDebugServerPath(m_ui->gdbServerLineEdit->text()); device()->setDebugServerPath(FilePath::fromString(m_ui->gdbServerLineEdit->text()));
} }
void GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged() void GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged()
@@ -212,6 +212,6 @@ void GenericLinuxDeviceConfigurationWidget::initGui()
m_ui->timeoutSpinBox->setValue(sshParams.timeout); m_ui->timeoutSpinBox->setValue(sshParams.timeout);
m_ui->userLineEdit->setText(sshParams.userName()); m_ui->userLineEdit->setText(sshParams.userName());
m_ui->keyFileLineEdit->setPath(sshParams.privateKeyFile); m_ui->keyFileLineEdit->setPath(sshParams.privateKeyFile);
m_ui->gdbServerLineEdit->setText(device()->debugServerPath()); m_ui->gdbServerLineEdit->setText(device()->debugServerPath().toString());
updatePortsWarningLabel(); updatePortsWarningLabel();
} }