summaryrefslogtreecommitdiff
path: root/src/plugins/clangformat
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2019-03-05 17:13:45 +0100
committerIvan Donchevskii <ivan.donchevskii@qt.io>2019-03-06 08:43:28 +0000
commit5bb8e678467ae6b1ee9d15ead673b06543740969 (patch)
treeb7a93365f2e9f2f127d237c5a10b54f0bac20cf1 /src/plugins/clangformat
parent31e549a7dce3b7f3c6dedc0f014162784e6cff08 (diff)
downloadqt-creator-5bb8e678467ae6b1ee9d15ead673b06543740969.tar.gz
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>
Diffstat (limited to 'src/plugins/clangformat')
-rw-r--r--src/plugins/clangformat/clangformatconfigwidget.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp
index 27192a67f6..feb61f3276 100644
--- a/src/plugins/clangformat/clangformatconfigwidget.cpp
+++ b/src/plugins/clangformat/clangformatconfigwidget.cpp
@@ -188,6 +188,9 @@ void ClangFormatConfigWidget::apply()
}
settings.write();
+ if (!m_ui->overrideDefault->isChecked())
+ return;
+
const QString text = m_ui->clangFormatOptionsTable->toPlainText();
clang::format::FormatStyle style;
style.Language = clang::format::FormatStyle::LK_Cpp;