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:
@@ -169,20 +169,12 @@ QString ProcessParameters::prettyArguments() const
|
||||
{
|
||||
QString margs = effectiveArguments();
|
||||
QString workDir = effectiveWorkingDirectory();
|
||||
#ifdef Q_OS_WIN
|
||||
QString args;
|
||||
#else
|
||||
QStringList args;
|
||||
#endif
|
||||
Utils::QtcProcess::SplitError err;
|
||||
args = Utils::QtcProcess::prepareArgs(margs, &err, &m_environment, &workDir);
|
||||
Utils::QtcProcess::Arguments args =
|
||||
Utils::QtcProcess::prepareArgs(margs, &err, Utils::HostOsInfo::hostOs(), &m_environment, &workDir);
|
||||
if (err != Utils::QtcProcess::SplitOk)
|
||||
return margs; // Sorry, too complex - just fall back.
|
||||
#ifdef Q_OS_WIN
|
||||
return args;
|
||||
#else
|
||||
return Utils::QtcProcess::joinArgs(args);
|
||||
#endif
|
||||
return args.toString();
|
||||
}
|
||||
|
||||
QString ProcessParameters::summary(const QString &displayName) const
|
||||
|
||||
Reference in New Issue
Block a user