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:
@@ -121,13 +121,14 @@ void FileUtils::openTerminal(const QString &path)
|
||||
// Get terminal application
|
||||
QString terminalEmulator;
|
||||
QStringList args;
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
const OsType hostOs = HostOsInfo::hostOs();
|
||||
if (hostOs == OsTypeWindows) {
|
||||
terminalEmulator = ConsoleProcess::defaultTerminalEmulator();
|
||||
} else if (HostOsInfo::isMacHost()) {
|
||||
} else if (hostOs == OsTypeMac) {
|
||||
terminalEmulator = ICore::resourcePath()
|
||||
+ QLatin1String("/scripts/openTerminal.command");
|
||||
} else {
|
||||
args = QtcProcess::splitArgs(ConsoleProcess::terminalEmulator(ICore::settings()));
|
||||
args = QtcProcess::splitArgs(ConsoleProcess::terminalEmulator(ICore::settings()), hostOs);
|
||||
terminalEmulator = args.takeFirst();
|
||||
args.append(QString::fromLocal8Bit(qgetenv("SHELL")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user