From 421046cb7bb432faa677d431db7937e718ff5997 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 9 Dec 2015 17:14:24 +0100 Subject: [PATCH] Clang: Remove left-over project settings Change-Id: I45a667c0bdd767697766ebe82b65b61253c77f56 Reviewed-by: Marco Bubke --- src/plugins/clangcodemodel/clangcodemodel.pro | 8 +- src/plugins/clangcodemodel/clangcodemodel.qbs | 5 - .../clangcodemodel/clangcodemodelplugin.cpp | 12 -- .../clangcodemodel/clangprojectsettings.cpp | 109 ------------------ .../clangcodemodel/clangprojectsettings.h | 81 ------------- .../clangprojectsettingspropertiespage.cpp | 41 ------- .../clangprojectsettingspropertiespage.h | 58 ---------- .../clangprojectsettingspropertiespage.ui | 90 --------------- 8 files changed, 1 insertion(+), 403 deletions(-) delete mode 100644 src/plugins/clangcodemodel/clangprojectsettings.cpp delete mode 100644 src/plugins/clangcodemodel/clangprojectsettings.h delete mode 100644 src/plugins/clangcodemodel/clangprojectsettingspropertiespage.cpp delete mode 100644 src/plugins/clangcodemodel/clangprojectsettingspropertiespage.h delete mode 100644 src/plugins/clangcodemodel/clangprojectsettingspropertiespage.ui diff --git a/src/plugins/clangcodemodel/clangcodemodel.pro b/src/plugins/clangcodemodel/clangcodemodel.pro index 436e15b6072..4949bed6c8f 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 eccd34b53bb..40a7d0e4ec2 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 ea7aa9c3d1b..31434871310 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 -#include -#include -#include - #include 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(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 92056a256b4..00000000000 --- 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( - 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 a5956d33dfa..00000000000 --- 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 - -#include -#include - -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 3fb2e797f05..00000000000 --- 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 f77ef342328..00000000000 --- 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 8b2fae3a6f9..00000000000 --- a/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.ui +++ /dev/null @@ -1,90 +0,0 @@ - - - ClangCodeModel::Internal::ClangProjectSettingsPropertiesPage - - - false - - - - 0 - 0 - 814 - 330 - - - - - - - - - Pre-compiled headers: - - - - - - - None - - - - - - - Build system (exact) - - - - - - - Build system (fuzzy) - - - - - - - Custom - - - - - - - false - - - - - - - false - - - Choose... - - - - - - - - - Qt::Vertical - - - - 20 - 12 - - - - - - - - -