aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-06-08 12:42:21 +0200
committerEike Ziller <eike.ziller@qt.io>2023-06-08 13:52:31 +0000
commit27a61d482f4e8e04c503783229b5ea5eb2143805 (patch)
tree3eb856906a72c25e8696761241af392f8389570d
parentf939f19b9dfc524fd99ea606955f05115eed158f (diff)
ClangFormat: Fix that formatting was wrongly disabled
After starting Qt Creator with the Beautifier plugin, turning its automatic format on save option on, and restarting Qt Creator _without_ the Beautifier plugin, clang format was no longer formatting on save. The clang format based formatting is supposed to be disabled if - the Beautifier plugin is enabled, and - its automatic format on save option is enabled. Fix the check for the first condition, the plugin can be present but disabled, explicitly check if it is enabled. Change-Id: I5c9c270dd47ceec665aebca5b613f0c4a5357d72 Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/plugins/clangformat/clangformatindenter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/clangformat/clangformatindenter.cpp b/src/plugins/clangformat/clangformatindenter.cpp
index 94e0fafd8e..fa3a9d5d63 100644
--- a/src/plugins/clangformat/clangformatindenter.cpp
+++ b/src/plugins/clangformat/clangformatindenter.cpp
@@ -32,7 +32,7 @@ static bool isBeautifierPluginActivated()
return std::find_if(specs.begin(),
specs.end(),
[](ExtensionSystem::PluginSpec *spec) {
- return spec->name() == "Beautifier";
+ return spec->name() == "Beautifier" && spec->isEffectivelyEnabled();
})
!= specs.end();
}