forked from qt-creator/qt-creator
Utils: Don't resolve relative paths in ProcessArgs::prepareCommand
Part of an attempt to disentangle streamline environment creation/setup. Searching is expensive and needs currently the proper environment. Change-Id: I95d93abf6c0cedeb8ba0b7a447345cd033ac2f25 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -632,12 +632,10 @@ void ProcessArgs::addArgs(QString *args, const QStringList &inArgs)
|
|||||||
bool ProcessArgs::prepareCommand(const CommandLine &cmdLine, QString *outCmd, ProcessArgs *outArgs,
|
bool ProcessArgs::prepareCommand(const CommandLine &cmdLine, QString *outCmd, ProcessArgs *outArgs,
|
||||||
const Environment *env, const FilePath *pwd)
|
const Environment *env, const FilePath *pwd)
|
||||||
{
|
{
|
||||||
FilePath executable = cmdLine.executable();
|
const FilePath executable = cmdLine.executable();
|
||||||
const QString arguments = cmdLine.arguments();
|
|
||||||
if (env && executable.isRelativePath())
|
|
||||||
executable = env->searchInPath(executable.toString());
|
|
||||||
if (executable.isEmpty())
|
if (executable.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
const QString arguments = cmdLine.arguments();
|
||||||
ProcessArgs::SplitError err;
|
ProcessArgs::SplitError err;
|
||||||
*outArgs = ProcessArgs::prepareArgs(arguments, &err, executable.osType(), env, pwd);
|
*outArgs = ProcessArgs::prepareArgs(arguments, &err, executable.osType(), env, pwd);
|
||||||
if (err == ProcessArgs::SplitOk) {
|
if (err == ProcessArgs::SplitOk) {
|
||||||
|
|||||||
Reference in New Issue
Block a user