forked from qt-creator/qt-creator
QtcProcess: Introduce a QtcProcess::Arguments class
This is used to get a platform-agnostic handle on "command line arguments". It essentially wraps a single QString on Windows, and a QStringList everywhere else. As a consequence, several occurrences of #ifdef Q_OS_* can be removed from the codebase. Change-Id: Ic93118c1bd0bce0ebb58f416d395dbaebb861772 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
@@ -201,11 +201,7 @@ void LldbEngine::setupInferior()
|
||||
const DebuggerStartParameters &sp = startParameters();
|
||||
|
||||
QString executable;
|
||||
#ifdef Q_OS_WIN
|
||||
QString args;
|
||||
#else
|
||||
QStringList args;
|
||||
#endif
|
||||
Utils::QtcProcess::Arguments args;
|
||||
Utils::QtcProcess::prepareCommand(QFileInfo(sp.executable).absoluteFilePath(),
|
||||
sp.processArgs, &executable, &args);
|
||||
|
||||
@@ -213,12 +209,8 @@ void LldbEngine::setupInferior()
|
||||
cmd.arg("executable", executable);
|
||||
cmd.arg("startMode", sp.startMode); // directly relying on this is brittle wrt. insertions, so check it here
|
||||
cmd.beginList("processArgs");
|
||||
#ifdef Q_OS_WIN
|
||||
// fixme?
|
||||
#else
|
||||
foreach (const QString &arg, args)
|
||||
foreach (const QString &arg, args.toUnixArgs())
|
||||
cmd.arg(arg.toUtf8().toHex());
|
||||
#endif
|
||||
cmd.endList();
|
||||
|
||||
// it is better not to check the start mode on the python sid (as we would have to duplicate the
|
||||
|
||||
Reference in New Issue
Block a user