forked from qt-creator/qt-creator
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:
@@ -694,7 +694,8 @@ void QtcProcess::start()
|
||||
const OsType osType = HostOsInfo::hostOs();
|
||||
if (m_haveEnv) {
|
||||
if (m_environment.size() == 0)
|
||||
qWarning("QtcProcess::start: Empty environment set when running '%s'.", qPrintable(m_command));
|
||||
qWarning("QtcProcess::start: Empty environment set when running '%s'.",
|
||||
qPrintable(m_commandLine.executable().toString()));
|
||||
env = m_environment;
|
||||
|
||||
QProcess::setEnvironment(env.toStringList());
|
||||
@@ -705,7 +706,9 @@ void QtcProcess::start()
|
||||
const QString &workDir = workingDirectory();
|
||||
QString command;
|
||||
QtcProcess::Arguments arguments;
|
||||
bool success = prepareCommand(m_command, m_arguments, &command, &arguments, osType, &env, &workDir);
|
||||
bool success = prepareCommand(m_commandLine.executable().toString(),
|
||||
m_commandLine.arguments(),
|
||||
&command, &arguments, osType, &env, &workDir);
|
||||
if (osType == OsTypeWindows) {
|
||||
QString args;
|
||||
if (m_useCtrlCStub) {
|
||||
|
||||
Reference in New Issue
Block a user