QmlJSPlugin: reorganize setup

Pimpl, remove use of global object pool, cosmetics, ...

Change-Id: I9e1415b07d7ff8e95db0998c87ce7d75ca638a8e
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
hjk
2018-02-08 10:40:29 +01:00
parent 5efd576020
commit 4248c53c79
8 changed files with 53 additions and 87 deletions

View File

@@ -25,48 +25,24 @@
#pragma once
#include <coreplugin/id.h>
#include <extensionsystem/iplugin.h>
QT_BEGIN_NAMESPACE
class QFileInfo;
class QDir;
class QAction;
QT_END_NAMESPACE
namespace QmlJSTools {
class QmlJSToolsSettings;
namespace Internal {
class ModelManager;
class QmlJSToolsPlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlJSTools.json")
public:
static QmlJSToolsPlugin *instance() { return m_instance; }
QmlJSToolsPlugin();
~QmlJSToolsPlugin();
bool initialize(const QStringList &arguments, QString *errorMessage);
void extensionsInitialized();
ShutdownFlag aboutToShutdown();
ModelManager *modelManager() { return m_modelManager; }
~QmlJSToolsPlugin() final;
private:
void onTaskStarted(Core::Id type);
void onAllTasksFinished(Core::Id type);
bool initialize(const QStringList &arguments, QString *errorMessage) final;
void extensionsInitialized() final;
ModelManager *m_modelManager;
QmlJSToolsSettings *m_settings;
QAction *m_resetCodeModelAction;
static QmlJSToolsPlugin *m_instance;
class QmlJSToolsPluginPrivate *d = nullptr;
#ifdef WITH_TESTS
private slots: