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>
This commit is contained in:
Eike Ziller
2023-06-08 12:42:21 +02:00
parent f939f19b9d
commit 27a61d482f

View File

@@ -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();
}