Debugger: Use new Utils::CommandLine in LocalProcessRunner

Change-Id: I41e67e5d52aa9a00d9e0fad3caf8da22391d2024
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2019-06-03 15:18:54 +02:00
parent 677a4692fa
commit d965df6483

View File

@@ -98,8 +98,8 @@ class LocalProcessRunner : public RunWorker
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::LocalProcessRunner) Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::LocalProcessRunner)
public: public:
LocalProcessRunner(DebuggerRunTool *runTool, const Runnable &runnable) LocalProcessRunner(DebuggerRunTool *runTool, const CommandLine &command)
: RunWorker(runTool->runControl()), m_runTool(runTool), m_runnable(runnable) : RunWorker(runTool->runControl()), m_runTool(runTool), m_command(command)
{ {
connect(&m_proc, &QProcess::errorOccurred, connect(&m_proc, &QProcess::errorOccurred,
this, &LocalProcessRunner::handleError); this, &LocalProcessRunner::handleError);
@@ -113,7 +113,7 @@ public:
void start() override void start() override
{ {
m_proc.setCommand(m_runnable.commandLine()); m_proc.setCommand(m_command);
m_proc.start(); m_proc.start();
} }
@@ -181,7 +181,7 @@ public:
} }
QPointer<DebuggerRunTool> m_runTool; QPointer<DebuggerRunTool> m_runTool;
Runnable m_runnable; CommandLine m_command;
Utils::QtcProcess m_proc; Utils::QtcProcess m_proc;
}; };
@@ -404,10 +404,8 @@ void DebuggerRunTool::setServerStartScript(const QString &serverStartScript)
{ {
if (!serverStartScript.isEmpty()) { if (!serverStartScript.isEmpty()) {
// Provide script information about the environment // Provide script information about the environment
Runnable serverStarter; CommandLine serverStarter(FileName::fromString(serverStartScript), {});
serverStarter.executable = serverStartScript; serverStarter.addArgs({m_runParameters.inferior.executable, m_runParameters.remoteChannel});
QtcProcess::addArg(&serverStarter.commandLineArguments, m_runParameters.inferior.executable);
QtcProcess::addArg(&serverStarter.commandLineArguments, m_runParameters.remoteChannel);
addStartDependency(new LocalProcessRunner(this, serverStarter)); addStartDependency(new LocalProcessRunner(this, serverStarter));
} }
} }