diff --git a/src/plugins/clangcodemodel/clangcodemodel.pro b/src/plugins/clangcodemodel/clangcodemodel.pro index 436e15b6072f6adb8bf0dbe9c1235ce0210cfa84..4949bed6c8f461d43289a1d20046a69cc9c65cc1 100644 --- a/src/plugins/clangcodemodel/clangcodemodel.pro +++ b/src/plugins/clangcodemodel/clangcodemodel.pro @@ -27,8 +27,6 @@ SOURCES += \ clangfunctionhintmodel.cpp \ clanghighlightingmarksreporter.cpp \ clangmodelmanagersupport.cpp \ - clangprojectsettings.cpp \ - clangprojectsettingspropertiespage.cpp \ clangtextmark.cpp \ clangutils.cpp @@ -55,12 +53,8 @@ HEADERS += \ clangfunctionhintmodel.h \ clanghighlightingmarksreporter.h \ clangmodelmanagersupport.h \ - clangprojectsettings.h \ - clangprojectsettingspropertiespage.h \ clangtextmark.h \ - clangutils.h \ - -FORMS += clangprojectsettingspropertiespage.ui + clangutils.h equals(TEST, 1) { HEADERS += \ diff --git a/src/plugins/clangcodemodel/clangcodemodel.qbs b/src/plugins/clangcodemodel/clangcodemodel.qbs index eccd34b53bb676256b03ae3dbbb389d781f5be36..40a7d0e4ec2d0c895dee7daaf3cdc281940e9f33 100644 --- a/src/plugins/clangcodemodel/clangcodemodel.qbs +++ b/src/plugins/clangcodemodel/clangcodemodel.qbs @@ -79,11 +79,6 @@ QtcPlugin { "clanghighlightingmarksreporter.h", "clangmodelmanagersupport.cpp", "clangmodelmanagersupport.h", - "clangprojectsettings.cpp", - "clangprojectsettings.h", - "clangprojectsettingspropertiespage.cpp", - "clangprojectsettingspropertiespage.h", - "clangprojectsettingspropertiespage.ui", "clangtextmark.cpp", "clangtextmark.h", "clangutils.cpp", diff --git a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp index ea7aa9c3d1b3bea52fe2a81008c4b71a2fd979e0..31434871310f264e5b1080c8ada2e181c2f6ea7f 100644 --- a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp +++ b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp @@ -31,7 +31,6 @@ #include "clangcodemodelplugin.h" #include "clangconstants.h" -#include "clangprojectsettingspropertiespage.h" #ifdef WITH_TESTS # include "test/clangcodecompletion_test.h" @@ -39,10 +38,6 @@ #include <cpptools/cppmodelmanager.h> -#include <projectexplorer/projectpanelfactory.h> -#include <projectexplorer/projectexplorer.h> -#include <projectexplorer/session.h> - #include <texteditor/textmark.h> namespace ClangCodeModel { @@ -65,13 +60,6 @@ bool ClangCodeModelPlugin::initialize(const QStringList &arguments, QString *err Q_UNUSED(arguments) 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 auto cppModelManager = CppTools::CppModelManager::instance(); cppModelManager->setClangModelManagerSupportProvider(&m_modelManagerSupportProvider); diff --git a/src/plugins/clangcodemodel/clangprojectsettings.cpp b/src/plugins/clangcodemodel/clangprojectsettings.cpp deleted file mode 100644 index 92056a256b4bd7f84a02121b3ab64012f50d9173..0000000000000000000000000000000000000000 --- a/src/plugins/clangcodemodel/clangprojectsettings.cpp +++ /dev/null @@ -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()); -} diff --git a/src/plugins/clangcodemodel/clangprojectsettings.h b/src/plugins/clangcodemodel/clangprojectsettings.h deleted file mode 100644 index a5956d33dfac452bb5143482f515ec90f7279b12..0000000000000000000000000000000000000000 --- a/src/plugins/clangcodemodel/clangprojectsettings.h +++ /dev/null @@ -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 diff --git a/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.cpp b/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.cpp deleted file mode 100644 index 3fb2e797f05d964cc22d566f259dbc9e3e79faa7..0000000000000000000000000000000000000000 --- a/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.cpp +++ /dev/null @@ -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); -} diff --git a/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.h b/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.h deleted file mode 100644 index f77ef342328b76a2991857d9625d639acd2bfb3a..0000000000000000000000000000000000000000 --- a/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.h +++ /dev/null @@ -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 diff --git a/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.ui b/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.ui deleted file mode 100644 index 8b2fae3a6f91141870cf419b222a49021e7fb5eb..0000000000000000000000000000000000000000 --- a/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.ui +++ /dev/null @@ -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>