From 3d3241227122fa2bc6a5e57f8bc6210730a7d9f0 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 19 Jan 2023 09:34:04 +0100 Subject: [PATCH] ClangCodeModel: Remove unused files Change-Id: Id9490ee1fcf16d16b6e675e9c5c09de47cb6dc09 Reviewed-by: Leena Miettinen Reviewed-by: Alessandro Portale Reviewed-by: Qt CI Bot --- .../clangprojectsettingswidget.cpp | 127 ------------------ .../clangprojectsettingswidget.h | 39 ------ .../clangprojectsettingswidget.ui | 67 --------- 3 files changed, 233 deletions(-) delete mode 100644 src/plugins/clangcodemodel/clangprojectsettingswidget.cpp delete mode 100644 src/plugins/clangcodemodel/clangprojectsettingswidget.h delete mode 100644 src/plugins/clangcodemodel/clangprojectsettingswidget.ui diff --git a/src/plugins/clangcodemodel/clangprojectsettingswidget.cpp b/src/plugins/clangcodemodel/clangprojectsettingswidget.cpp deleted file mode 100644 index a045560a126..00000000000 --- a/src/plugins/clangcodemodel/clangprojectsettingswidget.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "clangprojectsettingswidget.h" - -#include "clangmodelmanagersupport.h" -#include "clangprojectsettings.h" - -#include - -#include -#include -#include -#include -#include - -#include - -namespace ClangCodeModel { -namespace Internal { - -static Utils::Id configIdForProject(ClangProjectSettings &projectSettings) -{ - if (projectSettings.useGlobalConfig()) - return CppEditor::codeModelSettings()->clangDiagnosticConfigId(); - return projectSettings.warningConfigId(); -} - -ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project *project) - : m_projectSettings(ClangModelManagerSupport::instance()->projectSettings(project)) -{ - m_ui.setupUi(this); - setGlobalSettingsId(CppEditor::Constants::CPP_CODE_MODEL_SETTINGS_ID); - - using namespace CppEditor; - - m_ui.delayedTemplateParseCheckBox->setVisible(Utils::HostOsInfo::isWindowsHost()); - - connect(m_ui.clangDiagnosticConfigsSelectionWidget, - &ClangDiagnosticConfigsSelectionWidget::changed, - this, - [this]() { - // Save project's config id - const Utils::Id currentConfigId = m_ui.clangDiagnosticConfigsSelectionWidget - ->currentConfigId(); - m_projectSettings.setWarningConfigId(currentConfigId); - - // Save global custom configs - const ClangDiagnosticConfigs configs = m_ui.clangDiagnosticConfigsSelectionWidget - ->customConfigs(); - CppEditor::codeModelSettings()->setClangCustomDiagnosticConfigs(configs); - CppEditor::codeModelSettings()->toSettings(Core::ICore::settings()); - }); - - connect(this, &ProjectSettingsWidget::useGlobalSettingsChanged, - this, &ClangProjectSettingsWidget::onGlobalCustomChanged); - connect(m_ui.delayedTemplateParseCheckBox, &QCheckBox::toggled, - this, &ClangProjectSettingsWidget::onDelayedTemplateParseClicked); - connect(project, &ProjectExplorer::Project::aboutToSaveSettings, - this, &ClangProjectSettingsWidget::onAboutToSaveProjectSettings); - - connect(&m_projectSettings, &ClangProjectSettings::changed, - this, &ClangProjectSettingsWidget::syncWidgets); - connect(CppEditor::codeModelSettings(), &CppEditor::CppCodeModelSettings::changed, - this, &ClangProjectSettingsWidget::syncOtherWidgetsToComboBox); - - syncWidgets(); -} - -void ClangProjectSettingsWidget::onDelayedTemplateParseClicked(bool checked) -{ - // Don't save it when we reset the global config in code - if (m_projectSettings.useGlobalConfig()) - return; - - const QLatin1String extraFlag{checked ? ClangProjectSettings::DelayedTemplateParsing - : ClangProjectSettings::NoDelayedTemplateParsing}; - QStringList options = m_projectSettings.commandLineOptions(); - options.removeAll(QLatin1String{ClangProjectSettings::DelayedTemplateParsing}); - options.removeAll(QLatin1String{ClangProjectSettings::NoDelayedTemplateParsing}); - options.append(extraFlag); - m_projectSettings.setCommandLineOptions(options); -} - -void ClangProjectSettingsWidget::onGlobalCustomChanged(bool useGlobalSettings) -{ - m_projectSettings.setUseGlobalConfig(useGlobalSettings); - syncOtherWidgetsToComboBox(); -} - -void ClangProjectSettingsWidget::onAboutToSaveProjectSettings() -{ - CppEditor::codeModelSettings()->toSettings(Core::ICore::settings()); -} - -void ClangProjectSettingsWidget::syncWidgets() -{ - setUseGlobalSettings(m_projectSettings.useGlobalConfig()); - syncOtherWidgetsToComboBox(); -} - -void ClangProjectSettingsWidget::syncOtherWidgetsToComboBox() -{ - const QStringList options = m_projectSettings.commandLineOptions(); - m_ui.delayedTemplateParseCheckBox->setChecked( - options.contains(QLatin1String{ClangProjectSettings::DelayedTemplateParsing})); - - const bool isCustom = !m_projectSettings.useGlobalConfig(); - m_ui.delayedTemplateParseCheckBox->setEnabled(isCustom); - - for (int i = 0; i < m_ui.clangDiagnosticConfigsSelectionWidget->layout()->count(); ++i) { - QWidget *widget = m_ui.clangDiagnosticConfigsSelectionWidget->layout()->itemAt(i)->widget(); - if (widget) - widget->setEnabled(isCustom); - } - - m_ui.clangDiagnosticConfigsSelectionWidget - ->refresh(CppEditor::diagnosticConfigsModel(), - configIdForProject(m_projectSettings), - [](const CppEditor::ClangDiagnosticConfigs &configs, - const Utils::Id &configToSelect) { - return new CppEditor::ClangDiagnosticConfigsWidget(configs, configToSelect); - }); -} - -} // namespace Internal -} // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangprojectsettingswidget.h b/src/plugins/clangcodemodel/clangprojectsettingswidget.h deleted file mode 100644 index a43168b7a25..00000000000 --- a/src/plugins/clangcodemodel/clangprojectsettingswidget.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "ui_clangprojectsettingswidget.h" - -#include "clangprojectsettings.h" -#include - -#include - -namespace ProjectExplorer { class Project; } - -namespace ClangCodeModel { -namespace Internal { - -class ClangProjectSettingsWidget: public ProjectExplorer::ProjectSettingsWidget -{ - Q_OBJECT - -public: - explicit ClangProjectSettingsWidget(ProjectExplorer::Project *project); - -private: - void onDelayedTemplateParseClicked(bool); - void onGlobalCustomChanged(bool useGlobalSettings); - void onAboutToSaveProjectSettings(); - - void syncWidgets(); - void syncOtherWidgetsToComboBox(); - -private: - Ui::ClangProjectSettingsWidget m_ui; - ClangProjectSettings &m_projectSettings; -}; - -} // namespace Internal -} // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangprojectsettingswidget.ui b/src/plugins/clangcodemodel/clangprojectsettingswidget.ui deleted file mode 100644 index f7200ecead9..00000000000 --- a/src/plugins/clangcodemodel/clangprojectsettingswidget.ui +++ /dev/null @@ -1,67 +0,0 @@ - - - ClangCodeModel::Internal::ClangProjectSettingsWidget - - - true - - - - 0 - 0 - 814 - 330 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Parse templates in a MSVC-compliant way. This helps to parse headers for example from Active Template Library (ATL) or Windows Runtime Library (WRL). -However, using the relaxed and extended rules means also that no highlighting/completion can be provided within template functions. - - - Enable MSVC-compliant template parsing - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - CppEditor::ClangDiagnosticConfigsSelectionWidget - QWidget -
cppeditor/clangdiagnosticconfigsselectionwidget.h
-
-
- - -