Utils: Extract a CommandLine structure from a QtcProcess

We regularly pass around strings or filenames or pairs of strings
or filenames and stringlist etc the in the end will be used
as a kind of "command line", with quite a bit of ad-hoc user
code and QtcProcess::addArg etc to set them up and manipulate them.

Let's have a class for that concept.

Change-Id: I288ab939d853b32c717135a65242c584c2beab50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-05-28 18:59:45 +02:00
parent f50859e856
commit 4098be05b2
19 changed files with 56 additions and 25 deletions

View File

@@ -3556,7 +3556,8 @@ void GdbEngine::setupEngine()
gdbArgs << "-n";
showMessage("STARTING " + rp.debugger.executable + " " + gdbArgs.join(' '));
m_gdbProc.setCommand(rp.debugger.executable, QtcProcess::joinArgs(gdbArgs));
m_gdbProc.setCommand(CommandLine(FilePath::fromString(rp.debugger.executable),
QtcProcess::joinArgs(gdbArgs)));
if (QFileInfo(rp.debugger.workingDirectory).isDir())
m_gdbProc.setWorkingDirectory(rp.debugger.workingDirectory);
m_gdbProc.setEnvironment(rp.debugger.environment);