Utils: Fix compile for UNIX when using Qt5.9

QProcess::startDetached(qint64 *) has been introduced
in Qt5.10. When using Qt5.9 just use the old way where
it was not possible to set the environment for the
process. Additionally disable the respective UI part
to avoid complaining users.
Amends 626665b7a4 and 72ada44be3.

Change-Id: I34233402fe385035566484431838dd6edbda483e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Christian Stenger
2018-09-06 06:58:50 +02:00
parent 019092d7f6
commit 8c6975b0fc
2 changed files with 8 additions and 4 deletions

View File

@@ -436,7 +436,11 @@ bool ConsoleProcess::startTerminalEmulator(QSettings *settings, const QString &w
const Utils::Environment &env)
{
const TerminalCommand term = terminalEmulator(settings);
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
// for 5.9 and below we cannot set the environment
return QProcess::startDetached(term.command, QtcProcess::splitArgs(term.openArgs),
workingDir);
#else
QProcess process;
process.setProgram(term.command);
process.setArguments(QtcProcess::splitArgs(term.openArgs));
@@ -444,6 +448,7 @@ bool ConsoleProcess::startTerminalEmulator(QSettings *settings, const QString &w
process.setWorkingDirectory(workingDir);
return process.startDetached();
#endif
}
} // namespace Utils