forked from qt-creator/qt-creator
Utils: Set the working directory in QtcProcess::start
The m_process member is strictly speaking only needed for processes handled "fully locally", i.e. without diversion through any device. Better set it only when needed, even if only to avoid even unused locally illegal paths like "docker://123/tmp/x" as working directory. Change-Id: Ia9e686855ff0c213eb3be03def8c4cecc7ee37ae Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -288,7 +288,6 @@ void QtcProcess::setWorkingDirectory(const FilePath &dir)
|
|||||||
QTC_CHECK(dir.host() == d->m_commandLine.executable().host());
|
QTC_CHECK(dir.host() == d->m_commandLine.executable().host());
|
||||||
}
|
}
|
||||||
d->m_workingDirectory = dir;
|
d->m_workingDirectory = dir;
|
||||||
d->m_process->setWorkingDirectory(dir.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtcProcess::setWorkingDirectory(const QString &dir)
|
void QtcProcess::setWorkingDirectory(const QString &dir)
|
||||||
@@ -338,6 +337,7 @@ void QtcProcess::start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const QString workDir = d->m_workingDirectory.path();
|
const QString workDir = d->m_workingDirectory.path();
|
||||||
|
d->m_process->setWorkingDirectory(workDir);
|
||||||
|
|
||||||
QString command;
|
QString command;
|
||||||
ProcessArgs arguments;
|
ProcessArgs arguments;
|
||||||
|
Reference in New Issue
Block a user