forked from qt-creator/qt-creator
ClangCodeModel: Remove unused files
Change-Id: Id9490ee1fcf16d16b6e675e9c5c09de47cb6dc09 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -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 <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <cppeditor/clangdiagnosticconfig.h>
|
|
||||||
#include <cppeditor/clangdiagnosticconfigswidget.h>
|
|
||||||
#include <cppeditor/cppeditorconstants.h>
|
|
||||||
#include <cppeditor/cppcodemodelsettings.h>
|
|
||||||
#include <cppeditor/cpptoolsreuse.h>
|
|
||||||
|
|
||||||
#include <utils/hostosinfo.h>
|
|
||||||
|
|
||||||
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
|
|
@@ -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 <projectexplorer/projectsettingswidget.h>
|
|
||||||
|
|
||||||
#include <QPointer>
|
|
||||||
|
|
||||||
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
|
|
@@ -1,67 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>ClangCodeModel::Internal::ClangProjectSettingsWidget</class>
|
|
||||||
<widget class="QWidget" name="ClangCodeModel::Internal::ClangProjectSettingsWidget">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>814</width>
|
|
||||||
<height>330</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="delayedTemplateParseCheckBox">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>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.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable MSVC-compliant template parsing</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="CppEditor::ClangDiagnosticConfigsSelectionWidget" name="clangDiagnosticConfigsSelectionWidget" native="true"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>CppEditor::ClangDiagnosticConfigsSelectionWidget</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>cppeditor/clangdiagnosticconfigsselectionwidget.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
Reference in New Issue
Block a user