QmlProjectPlugin: Clean up

- Remove unneeded use of global object pool
- Remove a few unneeded includes and declarations
- Un-export class, it's not used from the outside

Change-Id: Iddfcf74b754c936a8adb23c2caa6f7eef6d0e654
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2018-02-15 14:51:31 +01:00
parent 5cf39393d9
commit a3154bf299
2 changed files with 11 additions and 22 deletions

View File

@@ -26,7 +26,6 @@
#include "qmlprojectplugin.h" #include "qmlprojectplugin.h"
#include "qmlproject.h" #include "qmlproject.h"
#include "qmlprojectrunconfigurationfactory.h" #include "qmlprojectrunconfigurationfactory.h"
#include "fileformat/qmlprojectfileformat.h"
#include <coreplugin/fileiconprovider.h> #include <coreplugin/fileiconprovider.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -35,18 +34,10 @@
#include <qmljstools/qmljstoolsconstants.h> #include <qmljstools/qmljstoolsconstants.h>
#include <QtPlugin>
#include <QApplication>
#include <QMessageBox>
#include <QPushButton>
using namespace ProjectExplorer; using namespace ProjectExplorer;
namespace QmlProjectManager { namespace QmlProjectManager {
namespace Internal {
QmlProjectPlugin::QmlProjectPlugin()
{ }
QmlProjectPlugin::~QmlProjectPlugin() QmlProjectPlugin::~QmlProjectPlugin()
{ {
@@ -56,15 +47,12 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
{ {
Q_UNUSED(errorMessage) Q_UNUSED(errorMessage)
addAutoReleasedObject(new Internal::QmlProjectRunConfigurationFactory); new Internal::QmlProjectRunConfigurationFactory(this);
ProjectManager::registerProjectType<QmlProject>(QmlJSTools::Constants::QMLPROJECT_MIMETYPE); ProjectManager::registerProjectType<QmlProject>(QmlJSTools::Constants::QMLPROJECT_MIMETYPE);
Core::FileIconProvider::registerIconOverlayForSuffix(":/qmlproject/images/qmlproject.png", "qmlproject"); Core::FileIconProvider::registerIconOverlayForSuffix(":/qmlproject/images/qmlproject.png", "qmlproject");
return true; return true;
} }
void QmlProjectPlugin::extensionsInitialized() } // namespace Internal
{
}
} // namespace QmlProjectManager } // namespace QmlProjectManager

View File

@@ -25,23 +25,24 @@
#pragma once #pragma once
#include "qmlprojectmanager_global.h"
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
namespace QmlProjectManager { namespace QmlProjectManager {
namespace Internal {
class QMLPROJECTMANAGER_EXPORT QmlProjectPlugin: public ExtensionSystem::IPlugin class QmlProjectPlugin: public ExtensionSystem::IPlugin
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProjectManager.json") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProjectManager.json")
public: public:
QmlProjectPlugin(); QmlProjectPlugin() = default;
~QmlProjectPlugin(); ~QmlProjectPlugin() final;
virtual bool initialize(const QStringList &arguments, QString *errorString); private:
virtual void extensionsInitialized(); bool initialize(const QStringList &arguments, QString *errorString) final;
void extensionsInitialized() final {}
}; };
} // namespace Internal
} // namespace QmlProject } // namespace QmlProject