forked from qt-creator/qt-creator
Core: Add some sanity check that settings containers don't auto-apply
We use manual 'Apply' in the dialog. Also, mark a few pages as non-autoapply that were recently changed away from PagedSettings again which did that autmatically. Change-Id: Id78cac2770658b18c420813802a0e77443329f39 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -30,6 +30,7 @@ CTestTool::CTestTool()
|
|||||||
: Autotest::ITestTool(false)
|
: Autotest::ITestTool(false)
|
||||||
{
|
{
|
||||||
setSettingsGroups("Autotest", "CTest");
|
setSettingsGroups("Autotest", "CTest");
|
||||||
|
setAutoApply(false);
|
||||||
|
|
||||||
setLayouter([this] {
|
setLayouter([this] {
|
||||||
return Row { Form {
|
return Row { Form {
|
||||||
|
@@ -129,6 +129,7 @@ AbstractSettings::AbstractSettings(const QString &name, const QString &ending)
|
|||||||
.pathAppended(name))
|
.pathAppended(name))
|
||||||
{
|
{
|
||||||
setSettingsGroups(Utils::Constants::BEAUTIFIER_SETTINGS_GROUP, name);
|
setSettingsGroups(Utils::Constants::BEAUTIFIER_SETTINGS_GROUP, name);
|
||||||
|
setAutoApply(false);
|
||||||
|
|
||||||
command.setSettingsKey("command");
|
command.setSettingsKey("command");
|
||||||
command.setExpectedKind(PathChooser::ExistingCommand);
|
command.setExpectedKind(PathChooser::ExistingCommand);
|
||||||
|
@@ -164,6 +164,13 @@ void IOptionsPage::apply()
|
|||||||
|
|
||||||
if (m_settingsProvider) {
|
if (m_settingsProvider) {
|
||||||
AspectContainer *container = m_settingsProvider();
|
AspectContainer *container = m_settingsProvider();
|
||||||
|
QTC_ASSERT(container, return);
|
||||||
|
// Sanity check: Aspects in option pages should not autoapply.
|
||||||
|
if (!container->aspects().isEmpty()) {
|
||||||
|
BaseAspect *aspect = container->aspects().first();
|
||||||
|
QTC_ASSERT(aspect, return);
|
||||||
|
QTC_ASSERT(!aspect->isAutoApply(), container->setAutoApply(false));
|
||||||
|
}
|
||||||
if (container->isDirty()) {
|
if (container->isDirty()) {
|
||||||
container->apply();
|
container->apply();
|
||||||
container->writeSettings();
|
container->writeSettings();
|
||||||
|
@@ -53,6 +53,8 @@ FakeVimSettings &settings()
|
|||||||
|
|
||||||
FakeVimSettings::FakeVimSettings()
|
FakeVimSettings::FakeVimSettings()
|
||||||
{
|
{
|
||||||
|
setAutoApply(false);
|
||||||
|
|
||||||
setup(&useFakeVim, false, "UseFakeVim", {}, Tr::tr("Use FakeVim"));
|
setup(&useFakeVim, false, "UseFakeVim", {}, Tr::tr("Use FakeVim"));
|
||||||
|
|
||||||
// Specific FakeVim settings
|
// Specific FakeVim settings
|
||||||
|
@@ -362,6 +362,7 @@ TerminalSettings &settings()
|
|||||||
TerminalSettings::TerminalSettings()
|
TerminalSettings::TerminalSettings()
|
||||||
{
|
{
|
||||||
setSettingsGroup("Terminal");
|
setSettingsGroup("Terminal");
|
||||||
|
setAutoApply(false);
|
||||||
|
|
||||||
enableTerminal.setSettingsKey("EnableTerminal");
|
enableTerminal.setSettingsKey("EnableTerminal");
|
||||||
enableTerminal.setLabelText(Tr::tr("Use internal terminal"));
|
enableTerminal.setLabelText(Tr::tr("Use internal terminal"));
|
||||||
|
@@ -31,6 +31,7 @@ VcpkgSettings &settings()
|
|||||||
VcpkgSettings::VcpkgSettings()
|
VcpkgSettings::VcpkgSettings()
|
||||||
{
|
{
|
||||||
setSettingsGroup("Vcpkg");
|
setSettingsGroup("Vcpkg");
|
||||||
|
setAutoApply(false);
|
||||||
|
|
||||||
vcpkgRoot.setSettingsKey("VcpkgRoot");
|
vcpkgRoot.setSettingsKey("VcpkgRoot");
|
||||||
vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory);
|
vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory);
|
||||||
|
Reference in New Issue
Block a user