ClangFormat: Remove unneeded warning

- Remove warning when .clang-format file is absent
- Remove warning when a page is nullptr in addTab function

Change-Id: I4232bc77eaac56c78707fc37aaf75b00b8af9006
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Artem Sokolovskii
2022-04-22 17:24:39 +02:00
parent ea6892d05d
commit 9afe4f958a
2 changed files with 6 additions and 1 deletions

View File

@@ -739,6 +739,9 @@ clang::format::FormatStyle ClangFormatBaseIndenter::styleForFile() const
Utils::FilePath filePath = filePathToCurrentSettings(
TextEditor::TextEditorSettings::codeStyle("Cpp")->currentPreferences());
if (!filePath.exists())
return qtcStyle();
clang::format::FormatStyle style;
style.Language = clang::format::FormatStyle::LK_Cpp;
const std::error_code error

View File

@@ -346,7 +346,9 @@ void CppCodeStylePreferencesWidget::setVisualizeWhitespace(bool on)
void CppCodeStylePreferencesWidget::addTab(CppCodeStyleWidget *page, QString tabName)
{
QTC_ASSERT(page, return);
if (!page)
return;
m_ui->categoryTab->addTab(page, tabName);
connect(page, &CppEditor::CppCodeStyleWidget::codeStyleSettingsChanged,