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:
Nikolai Kosjar
2019-10-01 16:53:01 +02:00
parent 0a15b001dd
commit 3090e744c2
21 changed files with 312 additions and 335 deletions

View File

@@ -25,6 +25,9 @@
#include "clangprojectsettings.h"
#include <cpptools/cppcodemodelsettings.h>
#include <cpptools/cpptoolsreuse.h>
#include <utils/qtcassert.h>
#include <utils/hostosinfo.h>
@@ -74,6 +77,9 @@ ClangProjectSettings::ClangProjectSettings(ProjectExplorer::Project *project)
Core::Id ClangProjectSettings::warningConfigId() const
{
const CppTools::ClangDiagnosticConfigsModel model = CppTools::diagnosticConfigsModel();
if (!model.hasConfigWithId(m_warningConfigId))
return CppTools::codeModelSettings()->defaultClangDiagnosticConfigId();
return m_warningConfigId;
}