iOS: Use run arguments more directly

This also treats the arguments list as an arguments list for running,
not as a single argument.

Change-Id: Ia95e02c6324947081147b8bf8084cdd3a7d1eaf0
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
hjk
2018-05-07 12:20:04 +02:00
parent 900cbf857b
commit e6d583913e
4 changed files with 10 additions and 20 deletions

View File

@@ -84,7 +84,6 @@ public:
IosRunConfigurationWidget(IosRunConfiguration *runConfiguration);
private:
void argumentsLineEditTextEdited();
void updateValues();
void setDeviceTypeIndex(int devIndex);
@@ -118,11 +117,6 @@ QWidget *IosRunConfiguration::createConfigurationWidget()
return new IosRunConfigurationWidget(this);
}
QString IosRunConfiguration::commandLineArguments() const
{
return extraAspect<ArgumentsAspect>()->arguments();
}
void IosRunConfiguration::updateDisplayNames()
{
if (DeviceTypeKitInformation::deviceTypeId(target()->kit()) == Constants::IOS_DEVICE_TYPE)

View File

@@ -49,7 +49,6 @@ public:
QWidget *createConfigurationWidget() override;
IosDeployStep *deployStep() const;
QString commandLineArguments() const;
Utils::FileName profilePath() const;
QString applicationName() const;
Utils::FileName bundleDirectory() const;

View File

@@ -37,6 +37,7 @@
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/target.h>
#include <projectexplorer/taskhub.h>
#include <projectexplorer/toolchain.h>
@@ -99,7 +100,7 @@ IosRunner::IosRunner(RunControl *runControl)
stopRunningRunControl(runControl);
auto runConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration());
m_bundleDir = runConfig->bundleDirectory().toString();
m_arguments = QStringList(runConfig->commandLineArguments());
m_arguments = runConfig->extraAspect<ArgumentsAspect>()->arguments();
m_device = DeviceKitInformation::device(runConfig->target()->kit());
m_deviceType = runConfig->deviceType();
}
@@ -124,14 +125,6 @@ QString IosRunner::bundlePath()
return m_bundleDir;
}
QStringList IosRunner::extraArgs()
{
QStringList res = m_arguments;
if (m_qmlServerPort.isValid())
res << QmlDebug::qmlDebugTcpArguments(m_qmlDebugServices, m_qmlServerPort);
return res;
}
QString IosRunner::deviceId()
{
IosDevice::ConstPtr dev = m_device.dynamicCast<const IosDevice>();
@@ -207,7 +200,12 @@ void IosRunner::start()
this, &IosRunner::handleToolExited);
connect(m_toolHandler, &IosToolHandler::finished,
this, &IosRunner::handleFinished);
m_toolHandler->requestRunApp(bundlePath(), extraArgs(), runType(), deviceId());
QStringList args = QtcProcess::splitArgs(m_arguments, OsTypeMac);
if (m_qmlServerPort.isValid())
args.append(QmlDebug::qmlDebugTcpArguments(m_qmlDebugServices, m_qmlServerPort));
m_toolHandler->requestRunApp(bundlePath(), args, runType(), deviceId());
}
void IosRunner::stop()
@@ -388,7 +386,7 @@ IosQmlProfilerSupport::IosQmlProfilerSupport(RunControl *runControl)
auto iosRunConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration());
StandardRunnable runnable;
runnable.executable = iosRunConfig->localExecutable().toUserOutput();
runnable.commandLineArguments = iosRunConfig->commandLineArguments();
runnable.commandLineArguments = iosRunConfig->extraAspect<ArgumentsAspect>()->arguments();
runControl->setDisplayName(iosRunConfig->applicationName());
runControl->setRunnable(runnable);

View File

@@ -53,7 +53,6 @@ public:
void setQmlDebugging(QmlDebug::QmlDebugServicesPreset qmlDebugServices);
QString bundlePath();
QStringList extraArgs();
QString deviceId();
IosToolHandler::RunKind runType();
bool cppDebug() const;
@@ -84,7 +83,7 @@ private:
IosToolHandler *m_toolHandler = nullptr;
QString m_bundleDir;
QStringList m_arguments;
QString m_arguments;
ProjectExplorer::IDevice::ConstPtr m_device;
IosDeviceType m_deviceType;
bool m_cppDebug = false;