forked from qt-creator/qt-creator
Clang: Remove left-over project settings
Change-Id: I45a667c0bdd767697766ebe82b65b61253c77f56 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -27,8 +27,6 @@ SOURCES += \
|
|||||||
clangfunctionhintmodel.cpp \
|
clangfunctionhintmodel.cpp \
|
||||||
clanghighlightingmarksreporter.cpp \
|
clanghighlightingmarksreporter.cpp \
|
||||||
clangmodelmanagersupport.cpp \
|
clangmodelmanagersupport.cpp \
|
||||||
clangprojectsettings.cpp \
|
|
||||||
clangprojectsettingspropertiespage.cpp \
|
|
||||||
clangtextmark.cpp \
|
clangtextmark.cpp \
|
||||||
clangutils.cpp
|
clangutils.cpp
|
||||||
|
|
||||||
@@ -55,12 +53,8 @@ HEADERS += \
|
|||||||
clangfunctionhintmodel.h \
|
clangfunctionhintmodel.h \
|
||||||
clanghighlightingmarksreporter.h \
|
clanghighlightingmarksreporter.h \
|
||||||
clangmodelmanagersupport.h \
|
clangmodelmanagersupport.h \
|
||||||
clangprojectsettings.h \
|
|
||||||
clangprojectsettingspropertiespage.h \
|
|
||||||
clangtextmark.h \
|
clangtextmark.h \
|
||||||
clangutils.h \
|
clangutils.h
|
||||||
|
|
||||||
FORMS += clangprojectsettingspropertiespage.ui
|
|
||||||
|
|
||||||
equals(TEST, 1) {
|
equals(TEST, 1) {
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
@@ -79,11 +79,6 @@ QtcPlugin {
|
|||||||
"clanghighlightingmarksreporter.h",
|
"clanghighlightingmarksreporter.h",
|
||||||
"clangmodelmanagersupport.cpp",
|
"clangmodelmanagersupport.cpp",
|
||||||
"clangmodelmanagersupport.h",
|
"clangmodelmanagersupport.h",
|
||||||
"clangprojectsettings.cpp",
|
|
||||||
"clangprojectsettings.h",
|
|
||||||
"clangprojectsettingspropertiespage.cpp",
|
|
||||||
"clangprojectsettingspropertiespage.h",
|
|
||||||
"clangprojectsettingspropertiespage.ui",
|
|
||||||
"clangtextmark.cpp",
|
"clangtextmark.cpp",
|
||||||
"clangtextmark.h",
|
"clangtextmark.h",
|
||||||
"clangutils.cpp",
|
"clangutils.cpp",
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
#include "clangcodemodelplugin.h"
|
#include "clangcodemodelplugin.h"
|
||||||
|
|
||||||
#include "clangconstants.h"
|
#include "clangconstants.h"
|
||||||
#include "clangprojectsettingspropertiespage.h"
|
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
# include "test/clangcodecompletion_test.h"
|
# include "test/clangcodecompletion_test.h"
|
||||||
@@ -39,10 +38,6 @@
|
|||||||
|
|
||||||
#include <cpptools/cppmodelmanager.h>
|
#include <cpptools/cppmodelmanager.h>
|
||||||
|
|
||||||
#include <projectexplorer/projectpanelfactory.h>
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
|
||||||
#include <projectexplorer/session.h>
|
|
||||||
|
|
||||||
#include <texteditor/textmark.h>
|
#include <texteditor/textmark.h>
|
||||||
|
|
||||||
namespace ClangCodeModel {
|
namespace ClangCodeModel {
|
||||||
@@ -65,13 +60,6 @@ bool ClangCodeModelPlugin::initialize(const QStringList &arguments, QString *err
|
|||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
Q_UNUSED(errorMessage)
|
Q_UNUSED(errorMessage)
|
||||||
|
|
||||||
// Register widget for project panel
|
|
||||||
auto panelFactory = new ProjectExplorer::ProjectPanelFactory();
|
|
||||||
panelFactory->setPriority(60);
|
|
||||||
panelFactory->setDisplayName(ClangProjectSettingsWidget::tr("Clang Settings"));
|
|
||||||
panelFactory->setSimpleCreateWidgetFunction<ClangProjectSettingsWidget>(QIcon());
|
|
||||||
ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory);
|
|
||||||
|
|
||||||
// Register ModelManagerSupportProvider
|
// Register ModelManagerSupportProvider
|
||||||
auto cppModelManager = CppTools::CppModelManager::instance();
|
auto cppModelManager = CppTools::CppModelManager::instance();
|
||||||
cppModelManager->setClangModelManagerSupportProvider(&m_modelManagerSupportProvider);
|
cppModelManager->setClangModelManagerSupportProvider(&m_modelManagerSupportProvider);
|
||||||
|
@@ -1,109 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2015 The Qt Company Ltd.
|
|
||||||
** Contact: http://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 http://www.qt.io/terms-conditions. For further information
|
|
||||||
** use the contact form at http://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
||||||
** rights. These rights are described in The Qt Company LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "clangprojectsettings.h"
|
|
||||||
|
|
||||||
using namespace ClangCodeModel;
|
|
||||||
|
|
||||||
ClangProjectSettings::ClangProjectSettings(ProjectExplorer::Project *project)
|
|
||||||
: m_project(project)
|
|
||||||
, m_pchUsage(PchUse_None)
|
|
||||||
{
|
|
||||||
Q_ASSERT(project);
|
|
||||||
|
|
||||||
connect(project, SIGNAL(settingsLoaded()),
|
|
||||||
this, SLOT(pullSettings()));
|
|
||||||
connect(project, SIGNAL(aboutToSaveSettings()),
|
|
||||||
this, SLOT(pushSettings()));
|
|
||||||
}
|
|
||||||
|
|
||||||
ClangProjectSettings::~ClangProjectSettings()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ProjectExplorer::Project *ClangProjectSettings::project() const
|
|
||||||
{
|
|
||||||
return m_project;
|
|
||||||
}
|
|
||||||
|
|
||||||
ClangProjectSettings::PchUsage ClangProjectSettings::pchUsage() const
|
|
||||||
{
|
|
||||||
return m_pchUsage;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClangProjectSettings::setPchUsage(ClangProjectSettings::PchUsage pchUsage)
|
|
||||||
{
|
|
||||||
if (pchUsage < PchUse_None || pchUsage > PchUse_Custom)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (m_pchUsage != pchUsage) {
|
|
||||||
m_pchUsage = pchUsage;
|
|
||||||
emit pchSettingsChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ClangProjectSettings::customPchFile() const
|
|
||||||
{
|
|
||||||
return m_customPchFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClangProjectSettings::setCustomPchFile(const QString &customPchFile)
|
|
||||||
{
|
|
||||||
if (m_customPchFile != customPchFile) {
|
|
||||||
m_customPchFile = customPchFile;
|
|
||||||
emit pchSettingsChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static QLatin1String PchUsageKey("PchUsage");
|
|
||||||
static QLatin1String CustomPchFileKey("CustomPchFile");
|
|
||||||
static QLatin1String SettingsNameKey("ClangProjectSettings");
|
|
||||||
|
|
||||||
void ClangProjectSettings::pushSettings()
|
|
||||||
{
|
|
||||||
QVariantMap settings;
|
|
||||||
settings[PchUsageKey] = m_pchUsage;
|
|
||||||
settings[CustomPchFileKey] = m_customPchFile;
|
|
||||||
|
|
||||||
QVariant s(settings);
|
|
||||||
m_project->setNamedSettings(SettingsNameKey, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClangProjectSettings::pullSettings()
|
|
||||||
{
|
|
||||||
QVariant s = m_project->namedSettings(SettingsNameKey);
|
|
||||||
QVariantMap settings = s.toMap();
|
|
||||||
|
|
||||||
const PchUsage storedPchUsage = static_cast<PchUsage>(
|
|
||||||
settings.value(PchUsageKey, PchUse_Unknown).toInt());
|
|
||||||
if (storedPchUsage != PchUse_Unknown)
|
|
||||||
setPchUsage(storedPchUsage);
|
|
||||||
setCustomPchFile(settings.value(CustomPchFileKey).toString());
|
|
||||||
}
|
|
@@ -1,81 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2015 The Qt Company Ltd.
|
|
||||||
** Contact: http://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 http://www.qt.io/terms-conditions. For further information
|
|
||||||
** use the contact form at http://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
||||||
** rights. These rights are described in The Qt Company LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef CLANGPROJECTSETTINGS_H
|
|
||||||
#define CLANGPROJECTSETTINGS_H
|
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
namespace ClangCodeModel {
|
|
||||||
|
|
||||||
class ClangProjectSettings: public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
enum PchUsage {
|
|
||||||
PchUse_Unknown = 0,
|
|
||||||
PchUse_None = 1,
|
|
||||||
PchUse_BuildSystem_Exact = 2,
|
|
||||||
PchUse_BuildSystem_Fuzzy = 3,
|
|
||||||
PchUse_Custom = 4
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
|
||||||
ClangProjectSettings(ProjectExplorer::Project *project);
|
|
||||||
virtual ~ClangProjectSettings();
|
|
||||||
|
|
||||||
ProjectExplorer::Project *project() const;
|
|
||||||
|
|
||||||
PchUsage pchUsage() const;
|
|
||||||
void setPchUsage(PchUsage pchUsage);
|
|
||||||
|
|
||||||
QString customPchFile() const;
|
|
||||||
void setCustomPchFile(const QString &customPchFile);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void pchSettingsChanged();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void pullSettings();
|
|
||||||
void pushSettings();
|
|
||||||
|
|
||||||
private:
|
|
||||||
ProjectExplorer::Project *m_project;
|
|
||||||
PchUsage m_pchUsage;
|
|
||||||
QString m_customPchFile;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // ClangCodeModel namespace
|
|
||||||
|
|
||||||
#endif // CLANGPROJECTSETTINGS_H
|
|
@@ -1,41 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2015 The Qt Company Ltd.
|
|
||||||
** Contact: http://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 http://www.qt.io/terms-conditions. For further information
|
|
||||||
** use the contact form at http://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
||||||
** rights. These rights are described in The Qt Company LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "clangprojectsettings.h"
|
|
||||||
#include "clangprojectsettingspropertiespage.h"
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
|
||||||
using namespace ClangCodeModel::Internal;
|
|
||||||
|
|
||||||
ClangProjectSettingsWidget::ClangProjectSettingsWidget(Project *project)
|
|
||||||
: m_project(project)
|
|
||||||
{
|
|
||||||
m_ui.setupUi(this);
|
|
||||||
}
|
|
@@ -1,58 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2015 The Qt Company Ltd.
|
|
||||||
** Contact: http://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 http://www.qt.io/terms-conditions. For further information
|
|
||||||
** use the contact form at http://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
||||||
** rights. These rights are described in The Qt Company LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef CLANGPROJECTSETTINGSPROPERTIESPAGE_H
|
|
||||||
#define CLANGPROJECTSETTINGSPROPERTIESPAGE_H
|
|
||||||
|
|
||||||
#include "ui_clangprojectsettingspropertiespage.h"
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
|
||||||
class Project;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace ClangCodeModel {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class ClangProjectSettingsWidget: public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
ClangProjectSettingsWidget(ProjectExplorer::Project *project);
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::ClangProjectSettingsPropertiesPage m_ui;
|
|
||||||
ProjectExplorer::Project *m_project;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // ClangCodeModel namespace
|
|
||||||
} // Internal namespace
|
|
||||||
|
|
||||||
#endif // CLANGPROJECTSETTINGSPROPERTIESPAGE_H
|
|
@@ -1,90 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>ClangCodeModel::Internal::ClangProjectSettingsPropertiesPage</class>
|
|
||||||
<widget class="QWidget" name="ClangCodeModel::Internal::ClangProjectSettingsPropertiesPage">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</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">
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Pre-compiled headers:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QRadioButton" name="noneButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>None</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QRadioButton" name="exactButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Build system (exact)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QRadioButton" name="fuzzyButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Build system (fuzzy)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QRadioButton" name="customButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Custom</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="2">
|
|
||||||
<widget class="QLineEdit" name="customField">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="3">
|
|
||||||
<widget class="QPushButton" name="chooseButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Choose...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>12</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
Reference in New Issue
Block a user