overhaul process argument handling

get away from argument stringlists. instead, use native shell command
lines which support quoting/splitting, environment variable expansion
and redirections with well-understood semantics.

Task-number: QTCREATORBUG-542
Task-number: QTCREATORBUG-1564
This commit is contained in:
Oswald Buddenhagen
2010-10-19 11:14:03 +02:00
parent 531c70f05b
commit 1e362b0f8b
91 changed files with 592 additions and 572 deletions

View File

@@ -37,6 +37,7 @@
#include <qt4projectmanager/qtversionmanager.h>
#include <utils/environment.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <debugger/debuggerrunner.h>
#include <debugger/debuggerplugin.h>
@@ -64,7 +65,9 @@ QmlRunControl::QmlRunControl(QmlProjectRunConfiguration *runConfiguration, QStri
: RunControl(runConfiguration, mode)
{
if (Qt4ProjectManager::QtVersion *qtVersion = runConfiguration->qtVersion())
m_applicationLauncher.setEnvironment(qtVersion->qmlToolsEnvironment().toStringList());
m_applicationLauncher.setEnvironment(qtVersion->qmlToolsEnvironment());
else
m_applicationLauncher.setEnvironment(Utils::Environment::systemEnvironment());
m_applicationLauncher.setWorkingDirectory(runConfiguration->workingDirectory());
if (mode == ProjectExplorer::Constants::RUNMODE) {
@@ -96,7 +99,7 @@ void QmlRunControl::start()
emit started();
emit appendMessage(this, tr("Starting %1 %2").arg(QDir::toNativeSeparators(m_executable),
m_commandLineArguments.join(QLatin1String(" "))), false);
m_commandLineArguments), false);
}
RunControl::StopResult QmlRunControl::stop()
@@ -200,10 +203,11 @@ ProjectExplorer::RunControl *QmlRunControlFactory::createDebugRunControl(QmlProj
params.qmlServerAddress = "127.0.0.1";
params.qmlServerPort = runConfig->qmlDebugServerPort();
params.processArgs = runConfig->viewerArguments();
params.processArgs.append(QLatin1String("-qmljsdebugger=port:") + QString::number(runConfig->qmlDebugServerPort()));
Utils::QtcProcess::addArg(&params.processArgs,
QLatin1String("-qmljsdebugger=port:") + QString::number(runConfig->qmlDebugServerPort()));
params.workingDirectory = runConfig->workingDirectory();
if (Qt4ProjectManager::QtVersion *qtVersion = runConfig->qtVersion())
params.environment = qtVersion->qmlToolsEnvironment().toStringList();
params.environment = qtVersion->qmlToolsEnvironment();
params.displayName = runConfig->displayName();
if (params.executable.isEmpty()) {