Commit e7956000 authored by hjk's avatar hjk

RemoteLinux: Use QString instead of QStringList for process arguments

This is almost uniformly used everywhere else.

Change-Id: I1ef9abb24066b21652aeb994b18ea3e19f48b3c6
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 9a0062a9
......@@ -79,7 +79,7 @@ static DebuggerStartParameters createDebuggerStartParameters(QnxRunConfiguration
params.remoteChannel = device->sshParameters().host + QLatin1String(":-1");
params.remoteSetupNeeded = true;
params.closeMode = KillAtClose;
params.processArgs = runConfig->arguments().join(QLatin1Char(' '));
params.processArgs = runConfig->arguments();
auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
if (aspect->useQmlDebugger()) {
......@@ -105,7 +105,7 @@ static AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfigu
return params;
params.debuggee = runConfig->remoteExecutableFilePath();
params.debuggeeArgs = runConfig->arguments().join(QLatin1Char(' '));
params.debuggeeArgs = runConfig->arguments();
params.connParams = DeviceKitInformation::device(runConfig->target()->kit())->sshParameters();
params.analyzerHost = params.connParams.host;
params.analyzerPort = params.connParams.port;
......
......@@ -33,8 +33,6 @@
#include "remotelinux_export.h"
#include <projectexplorer/runconfiguration.h>
QT_FORWARD_DECLARE_CLASS(QStringList)
namespace Utils { class Environment; }
namespace RemoteLinux {
......@@ -50,7 +48,7 @@ public:
virtual QString localExecutableFilePath() const = 0;
virtual QString remoteExecutableFilePath() const = 0;
virtual QStringList arguments() const = 0;
virtual QString arguments() const = 0;
virtual QString workingDirectory() const = 0;
virtual Utils::Environment environment() const = 0;
......
......@@ -59,8 +59,7 @@ public:
m_ui.localExecutablePathChooser->setExpectedKind(Utils::PathChooser::File);
m_ui.localExecutablePathChooser->setPath(m_runConfig->localExecutableFilePath());
m_ui.remoteExeLineEdit->setText(m_runConfig->remoteExecutableFilePath());
m_ui.argsLineEdit->setText(Utils::QtcProcess::joinArgs(m_runConfig->arguments(),
Utils::OsTypeLinux));
m_ui.argsLineEdit->setText(m_runConfig->arguments());
m_ui.workingDirLineEdit->setText(m_runConfig->workingDirectory());
connect(m_ui.localExecutablePathChooser, SIGNAL(pathChanged(QString)),
SLOT(handleLocalExecutableChanged(QString)));
......@@ -83,8 +82,7 @@ private slots:
}
void handleArgumentsChanged(const QString &arguments) {
m_runConfig->setArguments(Utils::QtcProcess::splitArgs(arguments.trimmed(),
Utils::OsTypeLinux));
m_runConfig->setArguments(arguments.trimmed());
}
void handleWorkingDirChanged(const QString &wd) {
......@@ -198,7 +196,11 @@ bool RemoteLinuxCustomRunConfiguration::fromMap(const QVariantMap &map)
return false;
setLocalExecutableFilePath(map.value(localExeKey()).toString());
setRemoteExecutableFilePath(map.value(remoteExeKey()).toString());
setArguments(map.value(argsKey()).toStringList());
QVariant args = map.value(argsKey());
if (args.type() == QVariant::StringList) // Until 3.7 a QStringList was stored.
setArguments(Utils::QtcProcess::joinArgs(args.toStringList(), Utils::OsTypeLinux));
else
setArguments(args.toString());
setWorkingDirectory(map.value(workingDirKey()).toString());
return true;
}
......
......@@ -55,13 +55,13 @@ public:
QString localExecutableFilePath() const override { return m_localExecutable; }
QString remoteExecutableFilePath() const override { return m_remoteExecutable; }
QStringList arguments() const override { return m_arguments; }
QString arguments() const override { return m_arguments; }
QString workingDirectory() const override { return m_workingDirectory; }
Utils::Environment environment() const override;
void setLocalExecutableFilePath(const QString &executable) { m_localExecutable = executable; }
void setRemoteExecutableFilePath(const QString &executable);
void setArguments(const QStringList &args) { m_arguments = args; }
void setArguments(const QString &args) { m_arguments = args; }
void setWorkingDirectory(const QString &wd) { m_workingDirectory = wd; }
static Core::Id runConfigId();
......@@ -72,7 +72,7 @@ private:
QString m_localExecutable;
QString m_remoteExecutable;
QStringList m_arguments;
QString m_arguments;
QString m_workingDirectory;
};
......
......@@ -44,7 +44,7 @@
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
#include <QPointer>
......@@ -99,11 +99,11 @@ DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractR
}
if (aspect->useCppDebugger()) {
aspect->setUseMultiProcess(true);
QStringList args = runConfig->arguments();
if (aspect->useQmlDebugger())
args.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices));
params.processArgs = Utils::QtcProcess::joinArgs(args, Utils::OsTypeLinux);
params.processArgs = runConfig->arguments();
if (aspect->useQmlDebugger()) {
params.processArgs.prepend(QLatin1Char(' '));
params.processArgs.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices));
}
params.executable = runConfig->localExecutableFilePath();
params.remoteChannel = device->sshParameters().host + QLatin1String(":-1");
params.remoteExecutable = runConfig->remoteExecutableFilePath();
......
......@@ -72,7 +72,7 @@ public:
}
QString targetName;
QStringList arguments;
QString arguments;
bool useAlternateRemoteExecutable;
QString alternateRemoteExecutable;
QString workingDirectory;
......@@ -147,7 +147,11 @@ bool RemoteLinuxRunConfiguration::fromMap(const QVariantMap &map)
if (!RunConfiguration::fromMap(map))
return false;
d->arguments = map.value(QLatin1String(ArgumentsKey)).toStringList();
QVariant args = map.value(QLatin1String(ArgumentsKey));
if (args.type() == QVariant::StringList) // Until 3.7 a QStringList was stored.
d->arguments = QtcProcess::joinArgs(args.toStringList(), OsTypeLinux);
else
d->arguments = args.toString();
d->targetName = map.value(QLatin1String(TargetNameKey)).toString();
d->useAlternateRemoteExecutable = map.value(QLatin1String(UseAlternateExeKey), false).toBool();
d->alternateRemoteExecutable = map.value(QLatin1String(AlternateExeKey)).toString();
......@@ -167,7 +171,7 @@ QString RemoteLinuxRunConfiguration::defaultDisplayName()
return tr("Run on Remote Device");
}
QStringList RemoteLinuxRunConfiguration::arguments() const
QString RemoteLinuxRunConfiguration::arguments() const
{
return d->arguments;
}
......@@ -198,7 +202,7 @@ QString RemoteLinuxRunConfiguration::remoteExecutableFilePath() const
void RemoteLinuxRunConfiguration::setArguments(const QString &args)
{
d->arguments = QtcProcess::splitArgs(args, OsTypeLinux); // TODO: Widget should be list-based.
d->arguments = args;
}
QString RemoteLinuxRunConfiguration::workingDirectory() const
......
......@@ -73,7 +73,7 @@ public:
QString localExecutableFilePath() const override;
QString defaultRemoteExecutableFilePath() const;
QString remoteExecutableFilePath() const override;
QStringList arguments() const override;
QString arguments() const override;
void setArguments(const QString &args);
QString workingDirectory() const override;
void setWorkingDirectory(const QString &wd);
......
......@@ -33,7 +33,6 @@
#include <coreplugin/coreicons.h>
#include <utils/detailswidget.h>
#include <utils/qtcprocess.h>
#include <QCoreApplication>
#include <QDir>
......@@ -154,8 +153,7 @@ void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayou
altRemoteExeLayout->addWidget(&d->useAlternateCommandBox);
d->genericWidgetsLayout.addRow(tr("Alternate executable on device:"), altRemoteExeWidget);
d->argsLineEdit.setText(Utils::QtcProcess::joinArgs(d->runConfiguration->arguments(),
Utils::OsTypeLinux));
d->argsLineEdit.setText(d->runConfiguration->arguments());
d->genericWidgetsLayout.addRow(tr("Arguments:"), &d->argsLineEdit);
d->workingDirLineEdit.setPlaceholderText(tr("<default>"));
......
......@@ -36,10 +36,9 @@
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorericons.h>
#include <projectexplorer/target.h>
#include <utils/environment.h>
#include <QString>
#include <QIcon>
#include <utils/environment.h>
#include <utils/qtcprocess.h>
using namespace ProjectExplorer;
......@@ -52,7 +51,7 @@ public:
DeviceApplicationRunner runner;
IDevice::ConstPtr device;
QString remoteExecutable;
QStringList arguments;
QString arguments;
Utils::Environment environment;
QString workingDir;
};
......@@ -93,7 +92,8 @@ void RemoteLinuxRunControl::start()
this, &RemoteLinuxRunControl::handleProgressReport);
d->runner.setEnvironment(d->environment);
d->runner.setWorkingDirectory(d->workingDir);
d->runner.start(d->device, d->remoteExecutable, d->arguments);
d->runner.start(d->device, d->remoteExecutable,
Utils::QtcProcess::splitArgs(d->arguments, Utils::OsTypeLinux));
}
RunControl::StopResult RemoteLinuxRunControl::stop()
......
......@@ -104,7 +104,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
qobject_cast<RemoteLinux::AbstractRemoteLinuxRunConfiguration *>(runConfiguration)) {
sp.debuggee = rc2->remoteExecutableFilePath();
sp.connParams = DeviceKitInformation::device(rc2->target()->kit())->sshParameters();
sp.debuggeeArgs = rc2->arguments().join(QLatin1Char(' '));
sp.debuggeeArgs = rc2->arguments();
} else {
QTC_ASSERT(false, return 0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment