Merge remote-tracking branch 'origin/10.0'

Change-Id: I8b36c1812b61dbe08fe3e7930f950e6b8e8a7079
This commit is contained in:
Eike Ziller
2023-04-24 08:52:35 +02:00
33 changed files with 699 additions and 95 deletions

View File

@@ -203,4 +203,10 @@ void ClangFormatGlobalConfigWidget::apply()
settings.write();
}
void ClangFormatGlobalConfigWidget::finish()
{
m_codeStyle->currentPreferences()->setTemporarilyReadOnly(
!ClangFormatSettings::instance().overrideDefaultFile());
}
} // namespace ClangFormat

View File

@@ -28,6 +28,7 @@ public:
QWidget *parent = nullptr);
~ClangFormatGlobalConfigWidget() override;
void apply() override;
void finish() override;
private:
void initCheckBoxes();

View File

@@ -215,9 +215,10 @@ bool getCurrentOverriddenSettings(const Utils::FilePath &filePath)
const ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::projectForFile(
filePath);
return getProjectUseGlobalSettings(project)
? ClangFormatSettings::instance().overrideDefaultFile()
: getProjectOverriddenSettings(project);
return getProjectUseGlobalSettings(project) ? !TextEditor::TextEditorSettings::codeStyle("Cpp")
->currentPreferences()
->isTemporarilyReadOnly()
: getProjectOverriddenSettings(project);
}
ClangFormatSettings::Mode getProjectIndentationOrFormattingSettings(