Clangformat: Brings back some of checkboxes

Brought back checkboxes: format while typing, format on save.
Brought back format while typing feature.
Global checkboxes will be hidden in project settings,
and visible for global.

Change-Id: I193cf9e13b10de22091edb5fe04aef957dd74586
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Artem Sokolovskii
2022-06-28 16:17:02 +02:00
parent 7899fd6fc4
commit 2f18256633
11 changed files with 111 additions and 13 deletions

View File

@@ -114,7 +114,13 @@ int ClangFormatIndenter::lastSaveRevision() const
bool ClangFormatIndenter::formatOnSave() const
{
return !isBeautifierOnSaveActivated() && formatCodeInsteadOfIndent();
return ClangFormatSettings::instance().formatOnSave() && !isBeautifierOnSaveActivated()
&& formatCodeInsteadOfIndent();
}
bool ClangFormatIndenter::formatWhileTyping() const
{
return ClangFormatSettings::instance().formatWhileTyping() && formatCodeInsteadOfIndent();
}
} // namespace ClangFormat