ClangFormat: Add file size threshold

Add file size threshold to prevent qtcreator freeze
when a file is big. The default value is 1MB.

Change-Id: I356c64cd5ca99a34413043896076dbab859538b6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Artem Sokolovskii
2023-05-11 11:34:08 +02:00
parent 80665d6acf
commit ac24b23ff8
6 changed files with 54 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ QT_BEGIN_NAMESPACE
class QCheckBox;
class QComboBox;
class QLabel;
class QSpinBox;
QT_END_NAMESPACE
namespace ProjectExplorer { class Project; }
@@ -37,6 +38,7 @@ private:
void initIndentationOrFormattingCombobox();
void initOverrideCheckBox();
void initUseGlobalSettingsCheckBox();
void initFileSizeThresholdSpinBox();
bool projectClangFormatFileExists();
@@ -47,6 +49,8 @@ private:
QLabel *m_projectHasClangFormat;
QLabel *m_formattingModeLabel;
QLabel *m_fileSizeThresholdLabel;
QSpinBox *m_fileSizeThresholdSpinBox;
QComboBox *m_indentingOrFormatting;
QCheckBox *m_formatWhileTyping;
QCheckBox *m_formatOnSave;