ClangFormat: Do not save settings if they are not overridden

Apply only settings from checkboxes in that case.

Change-Id: Ic6740ab9d769730bba4d04dcdde7ad1e2a464614
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2019-03-05 17:13:45 +01:00
parent 31e549a7dc
commit 5bb8e67846

View File

@@ -188,6 +188,9 @@ void ClangFormatConfigWidget::apply()
} }
settings.write(); settings.write();
if (!m_ui->overrideDefault->isChecked())
return;
const QString text = m_ui->clangFormatOptionsTable->toPlainText(); const QString text = m_ui->clangFormatOptionsTable->toPlainText();
clang::format::FormatStyle style; clang::format::FormatStyle style;
style.Language = clang::format::FormatStyle::LK_Cpp; style.Language = clang::format::FormatStyle::LK_Cpp;