forked from qt-creator/qt-creator
ClangFormat: Use relevant settings for each file
Existing Clang Format settings may not follow the project/global pattern but can be expected to be used for the indentation/formatting. So let's proceed with UI for global/project settings but use global settings only if there's no configuration found for the current file. Change-Id: I87c25ab3feb7e2e3deb0290848088657783cf972 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -139,7 +139,7 @@ void ClangFormatConfigWidget::initialize()
|
||||
|
||||
connect(m_ui->createFileButton, &QPushButton::clicked,
|
||||
this, [this]() {
|
||||
createStyleFileIfNeeded(m_project->projectDirectory(), false);
|
||||
createStyleFileIfNeeded(false);
|
||||
initialize();
|
||||
});
|
||||
return;
|
||||
@@ -160,8 +160,7 @@ void ClangFormatConfigWidget::initialize()
|
||||
tr("Current project has its own .clang-format file "
|
||||
"and can be configured in Projects > Clang Format."));
|
||||
}
|
||||
const QString settingsDir = Core::ICore::userResourcePath();
|
||||
createStyleFileIfNeeded(Utils::FileName::fromString(settingsDir), true);
|
||||
createStyleFileIfNeeded(true);
|
||||
m_ui->applyButton->hide();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user