forked from qt-creator/qt-creator
ClangTools: Remove BasicSettingsWidget
This removes the [ ] Build the project before Analysis from the run dialog as it seems unlikely that this option is useful per project. Change-Id: I65f2ae8d1e936883f27c360d5b7b518fd31cdf07 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -10,7 +10,6 @@ add_qtc_plugin(ClangTools
|
||||
PLUGIN_DEPENDS Core Debugger CppTools ${TST_COMPONENT}
|
||||
INCLUDES ${CLANG_INCLUDE_DIRS}
|
||||
SOURCES
|
||||
basicsettingswidget.cpp basicsettingswidget.h basicsettingswidget.ui
|
||||
clangfileinfo.h
|
||||
clangfixitsrefactoringchanges.cpp clangfixitsrefactoringchanges.h
|
||||
clangselectablefilesdialog.cpp clangselectablefilesdialog.h clangselectablefilesdialog.ui
|
||||
|
@@ -1,52 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "basicsettingswidget.h"
|
||||
#include "ui_basicsettingswidget.h"
|
||||
|
||||
#include "clangtoolsutils.h"
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
BasicSettingsWidget::BasicSettingsWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_ui(new Ui::BasicSettingsWidget)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
BasicSettingsWidget::~BasicSettingsWidget()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
Ui::BasicSettingsWidget *BasicSettingsWidget::ui()
|
||||
{
|
||||
return m_ui;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ClangTools
|
@@ -1,51 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
namespace Ui { class BasicSettingsWidget; }
|
||||
|
||||
class ClangExecutableVersion;
|
||||
|
||||
class BasicSettingsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BasicSettingsWidget(QWidget *parent = nullptr);
|
||||
~BasicSettingsWidget() override;
|
||||
|
||||
Ui::BasicSettingsWidget *ui();
|
||||
private:
|
||||
Ui::BasicSettingsWidget *m_ui;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ClangTools
|
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ClangTools::Internal::BasicSettingsWidget</class>
|
||||
<widget class="QWidget" name="ClangTools::Internal::BasicSettingsWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<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="buildBeforeAnalysis">
|
||||
<property name="text">
|
||||
<string>Build the project before analysis</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CppTools::ClangDiagnosticConfigsSelectionWidget" name="clangDiagnosticConfigsSelectionWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>CppTools::ClangDiagnosticConfigsSelectionWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>cpptools/clangdiagnosticconfigsselectionwidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@@ -26,7 +26,6 @@
|
||||
#include "clangselectablefilesdialog.h"
|
||||
|
||||
#include "ui_clangselectablefilesdialog.h"
|
||||
#include "ui_basicsettingswidget.h"
|
||||
|
||||
#include "clangtoolsprojectsettings.h"
|
||||
#include "clangtoolssettings.h"
|
||||
@@ -293,57 +292,36 @@ SelectableFilesDialog::SelectableFilesDialog(const ProjectInfo &projectInfo,
|
||||
m_ui->buttons->setStandardButtons(QDialogButtonBox::Cancel);
|
||||
m_ui->buttons->addButton(m_analyzeButton, QDialogButtonBox::AcceptRole);
|
||||
|
||||
CppTools::ClangDiagnosticConfigsSelectionWidget *diagnosticConfigsSelectionWidget
|
||||
= m_ui->basicSettingsWidget->ui()->clangDiagnosticConfigsSelectionWidget;
|
||||
QCheckBox *buildBeforeAnalysis = m_ui->basicSettingsWidget->ui()->buildBeforeAnalysis;
|
||||
buildBeforeAnalysis->setToolTip(hintAboutBuildBeforeAnalysis());
|
||||
CppTools::ClangDiagnosticConfigsSelectionWidget *diagnosticWidget = m_ui->diagnosticWidget;
|
||||
|
||||
ClangToolsProjectSettings *settings = ClangToolsProjectSettingsManager::getSettings(m_project);
|
||||
m_customDiagnosticConfig = diagnosticConfiguration(settings);
|
||||
m_buildBeforeAnalysis = settings->buildBeforeAnalysis();
|
||||
|
||||
if (settings->useGlobalSettings()) {
|
||||
m_ui->globalOrCustom->setCurrentIndex(GlobalSettings);
|
||||
m_ui->basicSettingsWidget->setEnabled(false);
|
||||
diagnosticConfigsSelectionWidget->refresh(
|
||||
ClangToolsSettings::instance()->savedDiagnosticConfigId());
|
||||
buildBeforeAnalysis->setCheckState(
|
||||
ClangToolsSettings::instance()->savedBuildBeforeAnalysis()
|
||||
? Qt::Checked : Qt::Unchecked);
|
||||
diagnosticWidget->refresh(ClangToolsSettings::instance()->savedDiagnosticConfigId());
|
||||
diagnosticWidget->setEnabled(false);
|
||||
} else {
|
||||
m_ui->globalOrCustom->setCurrentIndex(CustomSettings);
|
||||
m_ui->basicSettingsWidget->setEnabled(true);
|
||||
diagnosticConfigsSelectionWidget->refresh(m_customDiagnosticConfig);
|
||||
buildBeforeAnalysis->setCheckState(m_buildBeforeAnalysis ? Qt::Checked : Qt::Unchecked);
|
||||
diagnosticWidget->refresh(m_customDiagnosticConfig);
|
||||
diagnosticWidget->setEnabled(true);
|
||||
}
|
||||
|
||||
connect(m_ui->globalOrCustom,
|
||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
[=](int index){
|
||||
m_ui->basicSettingsWidget->setEnabled(index == CustomSettings);
|
||||
if (index == CustomSettings) {
|
||||
diagnosticConfigsSelectionWidget->refresh(m_customDiagnosticConfig);
|
||||
buildBeforeAnalysis->setCheckState(m_buildBeforeAnalysis ? Qt::Checked : Qt::Unchecked);
|
||||
} else {
|
||||
diagnosticConfigsSelectionWidget->refresh(
|
||||
ClangToolsSettings::instance()->savedDiagnosticConfigId());
|
||||
buildBeforeAnalysis->setCheckState(
|
||||
ClangToolsSettings::instance()->savedBuildBeforeAnalysis()
|
||||
? Qt::Checked : Qt::Unchecked);
|
||||
}
|
||||
diagnosticWidget->setEnabled(index == CustomSettings);
|
||||
if (index == CustomSettings)
|
||||
diagnosticWidget->refresh(m_customDiagnosticConfig);
|
||||
else
|
||||
diagnosticWidget->refresh(ClangToolsSettings::instance()->savedDiagnosticConfigId());
|
||||
});
|
||||
connect(diagnosticConfigsSelectionWidget,
|
||||
connect(diagnosticWidget,
|
||||
&ClangDiagnosticConfigsSelectionWidget::currentConfigChanged,
|
||||
[this](const Core::Id ¤tConfigId) {
|
||||
if (m_ui->globalOrCustom->currentIndex() == CustomSettings)
|
||||
m_customDiagnosticConfig = currentConfigId;
|
||||
});
|
||||
connect(buildBeforeAnalysis, &QCheckBox::toggled, [this](bool checked) {
|
||||
if (!checked)
|
||||
showHintAboutBuildBeforeAnalysis();
|
||||
if (m_ui->globalOrCustom->currentIndex() == CustomSettings)
|
||||
m_buildBeforeAnalysis = checked;
|
||||
});
|
||||
|
||||
// Restore selection
|
||||
if (settings->selectedDirs().isEmpty() && settings->selectedFiles().isEmpty())
|
||||
@@ -359,9 +337,9 @@ SelectableFilesDialog::SelectableFilesDialog(const ProjectInfo &projectInfo,
|
||||
connect(CppTools::codeModelSettings().data(), &CppTools::CppCodeModelSettings::changed,
|
||||
this, [=]() {
|
||||
if (m_ui->globalOrCustom->currentIndex() == CustomSettings) {
|
||||
diagnosticConfigsSelectionWidget->refresh(m_customDiagnosticConfig);
|
||||
diagnosticWidget->refresh(m_customDiagnosticConfig);
|
||||
} else {
|
||||
diagnosticConfigsSelectionWidget->refresh(
|
||||
diagnosticWidget->refresh(
|
||||
ClangToolsSettings::instance()->savedDiagnosticConfigId());
|
||||
}
|
||||
});
|
||||
@@ -378,12 +356,11 @@ void SelectableFilesDialog::accept()
|
||||
{
|
||||
ClangToolsProjectSettings *settings = ClangToolsProjectSettingsManager::getSettings(m_project);
|
||||
|
||||
// Save diagnostic configuration and flag to build before analysis
|
||||
// Save diagnostic configuration
|
||||
settings->setUseGlobalSettings(m_ui->globalOrCustom->currentIndex() == GlobalSettings);
|
||||
settings->setDiagnosticConfig(m_customDiagnosticConfig);
|
||||
settings->setBuildBeforeAnalysis(m_buildBeforeAnalysis);
|
||||
|
||||
// Save selection
|
||||
// Save file selection
|
||||
QSet<FilePath> checkedDirs;
|
||||
QSet<FilePath> checkedFiles;
|
||||
m_filesModel->minimalSelection(checkedDirs, checkedFiles);
|
||||
|
@@ -65,7 +65,6 @@ private:
|
||||
Core::Id m_customDiagnosticConfig;
|
||||
ProjectExplorer::Project *m_project;
|
||||
QPushButton *m_analyzeButton = nullptr;
|
||||
bool m_buildBeforeAnalysis = true;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -19,7 +19,7 @@
|
||||
<property name="title">
|
||||
<string>General</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
@@ -52,7 +52,7 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ClangTools::Internal::BasicSettingsWidget" name="basicSettingsWidget" native="true"/>
|
||||
<widget class="CppTools::ClangDiagnosticConfigsSelectionWidget" name="diagnosticWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -87,9 +87,9 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ClangTools::Internal::BasicSettingsWidget</class>
|
||||
<class>CppTools::ClangDiagnosticConfigsSelectionWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>clangtools/basicsettingswidget.h</header>
|
||||
<header>cpptools/clangdiagnosticconfigsselectionwidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#include "clangtidyclazytool.h"
|
||||
#include "clangtool.h"
|
||||
#include "clangtoolslogfilereader.h"
|
||||
#include "clangtoolsprojectsettings.h"
|
||||
#include "clangtoolssettings.h"
|
||||
#include "clangtoolsutils.h"
|
||||
|
||||
@@ -247,13 +246,7 @@ ClangToolRunWorker::ClangToolRunWorker(RunControl *runControl,
|
||||
if (!preventBuild) {
|
||||
m_projectBuilder = new ProjectBuilder(runControl);
|
||||
addStartDependency(m_projectBuilder);
|
||||
|
||||
ClangToolsProjectSettings *projectSettings = ClangToolsProjectSettingsManager::getSettings(
|
||||
runControl->project());
|
||||
if (projectSettings->useGlobalSettings())
|
||||
m_projectBuilder->setEnabled(ClangToolsSettings::instance()->savedBuildBeforeAnalysis());
|
||||
else
|
||||
m_projectBuilder->setEnabled(projectSettings->buildBeforeAnalysis());
|
||||
m_projectBuilder->setEnabled(ClangToolsSettings::instance()->savedBuildBeforeAnalysis());
|
||||
}
|
||||
|
||||
Target *target = runControl->target();
|
||||
@@ -510,8 +503,7 @@ void ClangToolRunWorker::finalize()
|
||||
TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID);
|
||||
Target *target = runControl()->target();
|
||||
if (target && !target->activeBuildConfiguration()->buildDirectory().exists()
|
||||
&& !ClangToolsProjectSettingsManager::getSettings(target->project())
|
||||
->buildBeforeAnalysis()) {
|
||||
&& !ClangToolsSettings::instance()->savedBuildBeforeAnalysis()) {
|
||||
msg = tr("%1: You might need to build the project to generate or update source "
|
||||
"files. To build automatically, enable \"Build the project before starting "
|
||||
"analysis\".")
|
||||
|
@@ -16,7 +16,6 @@ isEmpty(EXTERNAL_YAML_CPP_FOUND) {
|
||||
}
|
||||
|
||||
SOURCES += \
|
||||
basicsettingswidget.cpp \
|
||||
clangfixitsrefactoringchanges.cpp \
|
||||
clangselectablefilesdialog.cpp \
|
||||
clangtoolsdiagnosticview.cpp \
|
||||
@@ -36,7 +35,6 @@ SOURCES += \
|
||||
settingswidget.cpp \
|
||||
|
||||
HEADERS += \
|
||||
basicsettingswidget.h \
|
||||
clangfileinfo.h \
|
||||
clangfixitsrefactoringchanges.h \
|
||||
clangselectablefilesdialog.h \
|
||||
@@ -59,7 +57,6 @@ HEADERS += \
|
||||
settingswidget.h \
|
||||
|
||||
FORMS += \
|
||||
basicsettingswidget.ui \
|
||||
clangtoolsprojectsettingswidget.ui \
|
||||
settingswidget.ui \
|
||||
|
||||
|
@@ -31,9 +31,6 @@ QtcPlugin {
|
||||
cpp.rpaths: base.concat(libclang.llvmLibDir)
|
||||
|
||||
files: [
|
||||
"basicsettingswidget.cpp",
|
||||
"basicsettingswidget.h",
|
||||
"basicsettingswidget.ui",
|
||||
"clangfileinfo.h",
|
||||
"clangfixitsrefactoringchanges.cpp",
|
||||
"clangfixitsrefactoringchanges.h",
|
||||
|
@@ -36,7 +36,6 @@ namespace Internal {
|
||||
|
||||
static const char SETTINGS_KEY_USE_GLOBAL_SETTINGS[] = "ClangTools.UseGlobalSettings";
|
||||
static const char SETTINGS_KEY_DIAGNOSTIC_CONFIG[] = "ClangTools.DiagnosticConfig";
|
||||
static const char SETTINGS_KEY_BUILD_BEFORE_ANALYSIS[] = "ClangTools.BuildBeforeAnalysis";
|
||||
static const char SETTINGS_KEY_SELECTED_DIRS[] = "ClangTools.SelectedDirs";
|
||||
static const char SETTINGS_KEY_SELECTED_FILES[] = "ClangTools.SelectedFiles";
|
||||
static const char SETTINGS_KEY_SUPPRESSED_DIAGS[] = "ClangTools.SuppressedDiagnostics";
|
||||
@@ -86,9 +85,6 @@ void ClangToolsProjectSettings::load()
|
||||
m_diagnosticConfig = Core::Id::fromSetting(
|
||||
m_project->namedSettings(SETTINGS_KEY_DIAGNOSTIC_CONFIG));
|
||||
|
||||
const QVariant value = m_project->namedSettings(SETTINGS_KEY_BUILD_BEFORE_ANALYSIS);
|
||||
m_buildBeforeAnalysis = value.isValid() ? value.toBool() : true;
|
||||
|
||||
auto toFileName = [](const QString &s) { return Utils::FilePath::fromString(s); };
|
||||
|
||||
const QStringList dirs = m_project->namedSettings(SETTINGS_KEY_SELECTED_DIRS).toStringList();
|
||||
@@ -123,7 +119,6 @@ void ClangToolsProjectSettings::store()
|
||||
{
|
||||
m_project->setNamedSettings(SETTINGS_KEY_USE_GLOBAL_SETTINGS, m_useGlobalSettings);
|
||||
m_project->setNamedSettings(SETTINGS_KEY_DIAGNOSTIC_CONFIG, m_diagnosticConfig.toSetting());
|
||||
m_project->setNamedSettings(SETTINGS_KEY_BUILD_BEFORE_ANALYSIS, m_buildBeforeAnalysis);
|
||||
|
||||
const QStringList dirs = Utils::transform<QList>(m_selectedDirs, &Utils::FilePath::toString);
|
||||
m_project->setNamedSettings(SETTINGS_KEY_SELECTED_DIRS, dirs);
|
||||
@@ -162,16 +157,6 @@ void ClangToolsProjectSettings::setDiagnosticConfig(const Core::Id &diagnosticCo
|
||||
m_diagnosticConfig = diagnosticConfig;
|
||||
}
|
||||
|
||||
bool ClangToolsProjectSettings::buildBeforeAnalysis() const
|
||||
{
|
||||
return m_buildBeforeAnalysis;
|
||||
}
|
||||
|
||||
void ClangToolsProjectSettings::setBuildBeforeAnalysis(bool build)
|
||||
{
|
||||
m_buildBeforeAnalysis = build;
|
||||
}
|
||||
|
||||
ClangToolsProjectSettingsManager::ClangToolsProjectSettingsManager()
|
||||
{
|
||||
QObject::connect(ProjectExplorer::SessionManager::instance(),
|
||||
|
@@ -76,9 +76,6 @@ public:
|
||||
Core::Id diagnosticConfig() const;
|
||||
void setDiagnosticConfig(const Core::Id &diagnosticConfig);
|
||||
|
||||
bool buildBeforeAnalysis() const;
|
||||
void setBuildBeforeAnalysis(bool build);
|
||||
|
||||
QSet<Utils::FilePath> selectedDirs() const { return m_selectedDirs; }
|
||||
void setSelectedDirs(const QSet<Utils::FilePath> &value) { m_selectedDirs = value; }
|
||||
|
||||
@@ -103,7 +100,6 @@ private:
|
||||
QSet<Utils::FilePath> m_selectedDirs;
|
||||
QSet<Utils::FilePath> m_selectedFiles;
|
||||
SuppressedDiagnosticsList m_suppressedDiagnostics;
|
||||
bool m_buildBeforeAnalysis = true;
|
||||
};
|
||||
|
||||
class ClangToolsProjectSettingsManager
|
||||
|
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "settingswidget.h"
|
||||
|
||||
#include "ui_basicsettingswidget.h"
|
||||
#include "ui_settingswidget.h"
|
||||
|
||||
#include "clangtoolsconstants.h"
|
||||
@@ -124,7 +123,7 @@ SettingsWidget::SettingsWidget(ClangToolsSettings *settings, QWidget *parent)
|
||||
QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
[settings](int count) { settings->setSimultaneousProcesses(count); });
|
||||
|
||||
QCheckBox *buildBeforeAnalysis = m_ui->basicSettingsWidget->ui()->buildBeforeAnalysis;
|
||||
QCheckBox *buildBeforeAnalysis = m_ui->buildBeforeAnalysis;
|
||||
buildBeforeAnalysis->setToolTip(hintAboutBuildBeforeAnalysis());
|
||||
buildBeforeAnalysis->setCheckState(settings->savedBuildBeforeAnalysis()
|
||||
? Qt::Checked : Qt::Unchecked);
|
||||
@@ -134,11 +133,10 @@ SettingsWidget::SettingsWidget(ClangToolsSettings *settings, QWidget *parent)
|
||||
settings->setBuildBeforeAnalysis(checked);
|
||||
});
|
||||
|
||||
CppTools::ClangDiagnosticConfigsSelectionWidget *clangDiagnosticConfigsSelectionWidget
|
||||
= m_ui->basicSettingsWidget->ui()->clangDiagnosticConfigsSelectionWidget;
|
||||
clangDiagnosticConfigsSelectionWidget->refresh(settings->savedDiagnosticConfigId());
|
||||
CppTools::ClangDiagnosticConfigsSelectionWidget *diagnosticWidget = m_ui->diagnosticWidget;
|
||||
diagnosticWidget->refresh(settings->savedDiagnosticConfigId());
|
||||
|
||||
connect(clangDiagnosticConfigsSelectionWidget,
|
||||
connect(diagnosticWidget,
|
||||
&CppTools::ClangDiagnosticConfigsSelectionWidget::currentConfigChanged,
|
||||
this, [this](const Core::Id ¤tConfigId) {
|
||||
m_settings->setDiagnosticConfigId(currentConfigId);
|
||||
@@ -147,7 +145,7 @@ SettingsWidget::SettingsWidget(ClangToolsSettings *settings, QWidget *parent)
|
||||
connect(CppTools::codeModelSettings().data(), &CppTools::CppCodeModelSettings::changed,
|
||||
this, [=]() {
|
||||
// Settings were applied so apply also the current selection if possible.
|
||||
clangDiagnosticConfigsSelectionWidget->refresh(m_settings->diagnosticConfigId());
|
||||
diagnosticWidget->refresh(m_settings->diagnosticConfigId());
|
||||
m_settings->writeSettings();
|
||||
});
|
||||
}
|
||||
|
@@ -50,7 +50,14 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="ClangTools::Internal::BasicSettingsWidget" name="basicSettingsWidget" native="true"/>
|
||||
<widget class="CppTools::ClangDiagnosticConfigsSelectionWidget" name="diagnosticWidget" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="buildBeforeAnalysis">
|
||||
<property name="text">
|
||||
<string>Build the project before analysis</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="processesLayout">
|
||||
@@ -106,9 +113,9 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ClangTools::Internal::BasicSettingsWidget</class>
|
||||
<class>CppTools::ClangDiagnosticConfigsSelectionWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>clangtools/basicsettingswidget.h</header>
|
||||
<header>cpptools/clangdiagnosticconfigsselectionwidget.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Utils::PathChooser</class>
|
||||
|
Reference in New Issue
Block a user