From 8bf24bac3a135b61314a9f28dd62d97d021f00c6 Mon Sep 17 00:00:00 2001 From: Semih Yavuz Date: Sun, 19 Mar 2023 21:48:27 +0100 Subject: [PATCH] Remove auto-format-on-file-save dependency from custom formatter widgets We can use custom formatter not only with auto-formatting on file save, but also tools/qmljs/reformat file action. Hence, command and arguments lineedits of custom formatter should only be enabled/disabled by useCustomFormatter checkbox. useCustomFormatter also should not depend on auto-format-on-file-save checkbox's state. Change-Id: If1a634612f38395fd846166f4cc72593f5150f91 Reviewed-by: Reviewed-by: Xavier BESSON Reviewed-by: Eike Ziller --- src/plugins/qmljseditor/qmljseditingsettingspage.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp index 2a0ecb41771..6d9e95f4389 100644 --- a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp +++ b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp @@ -287,8 +287,7 @@ public: Utils::globalMacroExpander()); const auto updateFormatCommandState = [&, formatCommandLabel, formatCommandOptionsLabel] { - const bool enabled = useCustomFormatCommand->isChecked() - && autoFormatOnSave->isChecked(); + const bool enabled = useCustomFormatCommand->isChecked(); formatCommandLabel->setEnabled(enabled); formatCommand->setEnabled(enabled); formatCommandOptionsLabel->setEnabled(enabled); @@ -298,7 +297,6 @@ public: connect(autoFormatOnSave, &QCheckBox::toggled, this, [&, updateFormatCommandState]() { autoFormatOnlyCurrentProject->setEnabled(autoFormatOnSave->isChecked()); - useCustomFormatCommand->setEnabled(autoFormatOnSave->isChecked()); updateFormatCommandState(); }); connect(useCustomFormatCommand, &QCheckBox::toggled, this, updateFormatCommandState);