From 463eca4053240fe8420ad18ebecb1824a59ffebf Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 29 Aug 2012 12:40:38 +0200 Subject: [PATCH] QmlDesigner.Integration: Remove integration core This class had only one function and was rather useless. Change-Id: I99fa64881cdf29cf074e6d4173eec6ea85cc2a2a Reviewed-by: Alessandro Portale --- .../components/integration/integration.pri | 2 - .../integration/integrationcore.cpp | 95 ------------------- .../components/integration/integrationcore.h | 65 ------------- src/plugins/qmldesigner/designmodewidget.h | 2 - src/plugins/qmldesigner/qmldesignerplugin.cpp | 7 +- src/plugins/qmldesigner/qmldesignerplugin.h | 8 +- 6 files changed, 4 insertions(+), 175 deletions(-) delete mode 100644 src/plugins/qmldesigner/components/integration/integrationcore.cpp delete mode 100644 src/plugins/qmldesigner/components/integration/integrationcore.h diff --git a/src/plugins/qmldesigner/components/integration/integration.pri b/src/plugins/qmldesigner/components/integration/integration.pri index 15486889986..66efed89716 100644 --- a/src/plugins/qmldesigner/components/integration/integration.pri +++ b/src/plugins/qmldesigner/components/integration/integration.pri @@ -1,7 +1,6 @@ VPATH += $$PWD INCLUDEPATH += $$PWD SOURCES += \ - integrationcore.cpp \ designdocumentcontroller.cpp \ designdocumentcontrollerview.cpp \ utilitypanelcontroller.cpp \ @@ -11,7 +10,6 @@ SOURCES += \ xuifiledialog.cpp HEADERS += \ - integrationcore.h \ designdocumentcontrollerview.h \ designdocumentcontroller.h \ utilitypanelcontroller.h \ diff --git a/src/plugins/qmldesigner/components/integration/integrationcore.cpp b/src/plugins/qmldesigner/components/integration/integrationcore.cpp deleted file mode 100644 index 825cd679489..00000000000 --- a/src/plugins/qmldesigner/components/integration/integrationcore.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "integrationcore.h" -#include "pluginmanager.h" -#include "itemlibraryview.h" -#include "navigatorwidget.h" -#include "metainfo.h" - -#include -#include - -namespace QmlDesigner { - -class CorePrivate -{ - public: - CorePrivate(); - ~CorePrivate(); - - static IntegrationCore *m_instance; - - PluginManager m_pluginManager; -}; - -CorePrivate::CorePrivate() -{ -} - -CorePrivate::~CorePrivate() -{ - MetaInfo::clearGlobal(); -} - -IntegrationCore *CorePrivate::m_instance = 0; - -/*! - \class QmlDesigner::Core - - Convenience class to access the plugin manager singleton, - and manage the lifecycle of static data (e.g. in the metatype system). -*/ - -IntegrationCore::IntegrationCore() : - d(new CorePrivate) -{ - Q_ASSERT(CorePrivate::m_instance == 0); - CorePrivate::m_instance = this; -} - -IntegrationCore::~IntegrationCore() -{ - CorePrivate::m_instance = 0; - delete d; -} - -IntegrationCore *IntegrationCore::instance() -{ - Q_ASSERT(CorePrivate::m_instance); - return CorePrivate::m_instance; -} - -PluginManager *IntegrationCore::pluginManager() const -{ - return &d->m_pluginManager; -} - -} diff --git a/src/plugins/qmldesigner/components/integration/integrationcore.h b/src/plugins/qmldesigner/components/integration/integrationcore.h deleted file mode 100644 index 14a66f0c6ef..00000000000 --- a/src/plugins/qmldesigner/components/integration/integrationcore.h +++ /dev/null @@ -1,65 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef QMLDESIGNERCORE_H -#define QMLDESIGNERCORE_H - -#include - -QT_BEGIN_NAMESPACE -class QWidget; -class QDialog; -QT_END_NAMESPACE - -namespace QmlDesigner { - -class ItemLibraryWidget; -class FormWindowManager; -class PluginManager; -class CorePrivate; - -class IntegrationCore -{ - Q_DISABLE_COPY(IntegrationCore) -public: - IntegrationCore(); - ~IntegrationCore(); - - PluginManager *pluginManager() const; - - static IntegrationCore *instance(); - -private: - CorePrivate *d; -}; - -} // namspace QmlDesigner - -#endif // QMLDESIGNERCORE_H diff --git a/src/plugins/qmldesigner/designmodewidget.h b/src/plugins/qmldesigner/designmodewidget.h index 8d54b0c5ff6..70017b94490 100644 --- a/src/plugins/qmldesigner/designmodewidget.h +++ b/src/plugins/qmldesigner/designmodewidget.h @@ -36,8 +36,6 @@ #include #include -#include - #include #include #include diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index 40c5788cc6e..33b8d4a9a59 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -58,8 +58,6 @@ #include #include -#include - #include #include @@ -80,7 +78,6 @@ bool shouldAssertInException() } BauhausPlugin::BauhausPlugin() : - m_designerCore(0), m_designMode(0), m_isActive(false), m_revertToSavedAction(new QAction(this)), @@ -107,7 +104,6 @@ BauhausPlugin::BauhausPlugin() : BauhausPlugin::~BauhausPlugin() { - delete m_designerCore; Core::ICore::removeContextObject(m_context); } @@ -126,14 +122,13 @@ bool BauhausPlugin::initialize(const QStringList & /*arguments*/, QString *error switchAction, QmlDesigner::Constants::SWITCH_TEXT_DESIGN, switchContext); command->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); - m_designerCore = new QmlDesigner::IntegrationCore; m_pluginInstance = this; const QString pluginPath = Utils::HostOsInfo::isMacHost() ? QString(QCoreApplication::applicationDirPath() + "/../PlugIns/QmlDesigner") : QString(QCoreApplication::applicationDirPath() + "/../" + QLatin1String(IDE_LIBRARY_BASENAME) + "/qtcreator/qmldesigner"); - m_designerCore->pluginManager()->setPluginPaths(QStringList() << pluginPath); + m_pluginManager.setPluginPaths(QStringList() << pluginPath); createDesignModeWidget(); connect(switchAction, SIGNAL(triggered()), this, SLOT(switchTextDesign())); diff --git a/src/plugins/qmldesigner/qmldesignerplugin.h b/src/plugins/qmldesigner/qmldesignerplugin.h index aac2138af51..789d1ab8aa6 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.h +++ b/src/plugins/qmldesigner/qmldesignerplugin.h @@ -35,6 +35,8 @@ #include +#include + #include #include @@ -50,10 +52,6 @@ namespace Core { class EditorManager; } -namespace QmlDesigner { - class IntegrationCore; -} - namespace QmlDesigner { namespace Internal { @@ -92,7 +90,7 @@ private: QStringList m_mimeTypes; DesignModeWidget *m_mainWidget; - QmlDesigner::IntegrationCore *m_designerCore; + QmlDesigner::PluginManager m_pluginManager; static BauhausPlugin *m_pluginInstance; DesignerSettings m_settings; DesignModeContext *m_context;