forked from qt-creator/qt-creator
ClangTools: Polish ClangDiagnosticConfigsWidget
* Improve distinction between built-in and custom configs by introducing corresponding parent nodes * Add button to rename a config * Make closing the dialog apply the selected config. * Adapt also the related ClangDiagnosticConfigsSelectionWidget showing a combo box of the diagnostic configs and a "Manage..." button: Remove the combo box and show the current config as the button text. Change-Id: Ic015df37f2532f84bd7da6cd20bfce07799a97b8 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -196,6 +196,8 @@ void CppCodeModelSettings::toSettings(QSettings *s)
|
||||
|
||||
Core::Id CppCodeModelSettings::clangDiagnosticConfigId() const
|
||||
{
|
||||
if (!diagnosticConfigsModel().hasConfigWithId(m_clangDiagnosticConfigId))
|
||||
return defaultClangDiagnosticConfigId();
|
||||
return m_clangDiagnosticConfigId;
|
||||
}
|
||||
|
||||
@@ -204,9 +206,9 @@ void CppCodeModelSettings::setClangDiagnosticConfigId(const Core::Id &configId)
|
||||
m_clangDiagnosticConfigId = configId;
|
||||
}
|
||||
|
||||
void CppCodeModelSettings::resetClangDiagnosticConfigId()
|
||||
Core::Id CppCodeModelSettings::defaultClangDiagnosticConfigId()
|
||||
{
|
||||
m_clangDiagnosticConfigId = initialClangDiagnosticConfigId();
|
||||
return initialClangDiagnosticConfigId();
|
||||
}
|
||||
|
||||
const ClangDiagnosticConfig CppCodeModelSettings::clangDiagnosticConfig() const
|
||||
|
||||
Reference in New Issue
Block a user