forked from qt-creator/qt-creator
Utils: Remove 4.8 compatibility code for reading terminal settings
4.8 was released end of 2018 and the setting is not critical. Change-Id: I02856e98303debd3a1adc28d49b28c5d728ad553 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -4,10 +4,8 @@
|
|||||||
#include "terminalcommand.h"
|
#include "terminalcommand.h"
|
||||||
|
|
||||||
#include "algorithm.h"
|
#include "algorithm.h"
|
||||||
#include "commandline.h"
|
|
||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "hostosinfo.h"
|
#include "hostosinfo.h"
|
||||||
#include "qtcassert.h"
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@@ -119,27 +117,10 @@ const char kTerminalExecuteOptionsKey[] = "General/Terminal/ExecuteOptions";
|
|||||||
|
|
||||||
TerminalCommand TerminalCommand::terminalEmulator()
|
TerminalCommand TerminalCommand::terminalEmulator()
|
||||||
{
|
{
|
||||||
if (s_settings && HostOsInfo::isAnyUnixHost()) {
|
if (s_settings && HostOsInfo::isAnyUnixHost() && s_settings->contains(kTerminalCommandKey)) {
|
||||||
if (s_settings->value(kTerminalVersionKey).toString() == kTerminalVersion) {
|
|
||||||
if (s_settings->contains(kTerminalCommandKey))
|
|
||||||
return {s_settings->value(kTerminalCommandKey).toString(),
|
return {s_settings->value(kTerminalCommandKey).toString(),
|
||||||
s_settings->value(kTerminalOpenOptionsKey).toString(),
|
s_settings->value(kTerminalOpenOptionsKey).toString(),
|
||||||
s_settings->value(kTerminalExecuteOptionsKey).toString()};
|
s_settings->value(kTerminalExecuteOptionsKey).toString()};
|
||||||
} else {
|
|
||||||
// TODO remove reading of old settings some time after 4.8
|
|
||||||
const QString value = s_settings->value("General/TerminalEmulator").toString().trimmed();
|
|
||||||
if (!value.isEmpty()) {
|
|
||||||
// split off command and options
|
|
||||||
const QStringList splitCommand = ProcessArgs::splitArgs(value);
|
|
||||||
if (QTC_GUARD(!splitCommand.isEmpty())) {
|
|
||||||
const QString command = splitCommand.first();
|
|
||||||
const QStringList quotedArgs = transform(splitCommand.mid(1),
|
|
||||||
&ProcessArgs::quoteArgUnix);
|
|
||||||
const QString options = quotedArgs.join(' ');
|
|
||||||
return {command, "", options};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultTerminalEmulator();
|
return defaultTerminalEmulator();
|
||||||
|
|||||||
Reference in New Issue
Block a user