forked from qt-creator/qt-creator
Terminal: Clean up settings
Qt Creator <= 10 accidentally wrote the default terminal into the
settings on macOS instead of leaving the values empty. So the change
from "openTerminal.py" to just "Terminal.app" might not be correctly
reflected in the settings.
Make sure that the terminal setting is removed in all cases, if it is
set to the default.
Amends f003234510
Change-Id: I9d099999f55b4003ac6e7f4a4b679b893eaffc90
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -114,6 +114,8 @@ TerminalCommand TerminalCommand::terminalEmulator()
|
||||
if (s_settings && HostOsInfo::isAnyUnixHost() && s_settings->contains(kTerminalCommandKey)) {
|
||||
FilePath command = FilePath::fromSettings(s_settings->value(kTerminalCommandKey));
|
||||
|
||||
// TODO Remove some time after Qt Creator 11
|
||||
// Work around Qt Creator <= 10 writing the default terminal to the settings.
|
||||
if (HostOsInfo::isMacHost() && command.endsWith("openTerminal.py"))
|
||||
command = FilePath::fromString("Terminal.app");
|
||||
|
||||
|
@@ -63,6 +63,7 @@
|
||||
#include <utils/stylehelper.h>
|
||||
#include <utils/theme/theme.h>
|
||||
#include <utils/touchbar/touchbar.h>
|
||||
#include <utils/terminalcommand.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <QAbstractProxyModel>
|
||||
@@ -1228,6 +1229,14 @@ void MainWindow::saveSettings()
|
||||
EditorManagerPrivate::saveSettings();
|
||||
m_leftNavigationWidget->saveSettings(settings);
|
||||
m_rightNavigationWidget->saveSettings(settings);
|
||||
|
||||
// TODO Remove some time after Qt Creator 11
|
||||
// Work around Qt Creator <= 10 writing the default terminal to the settings.
|
||||
// TerminalCommand writes the terminal to the settings when changing it, which usually is
|
||||
// enough. But because of the bug in Qt Creator <= 10 we want to clean up the settings
|
||||
// even if the user never touched the terminal setting.
|
||||
if (HostOsInfo::isMacHost())
|
||||
TerminalCommand::setTerminalEmulator(TerminalCommand::terminalEmulator());
|
||||
}
|
||||
|
||||
void MainWindow::saveWindowSettings()
|
||||
|
Reference in New Issue
Block a user