From 24520b91595c1479716c3e45bf89a8a5fe0f3d37 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 8 Feb 2018 11:58:59 +0100 Subject: [PATCH] QmakeAndroidSupport: Pimpl and remove use of global object pool Change-Id: I2b893ac8fd72d920a538739de2c0ccfa2a9ba354 Reviewed-by: Vikas Pachdha --- .../qmakeandroidsupportplugin.cpp | 29 +++++++++---------- .../qmakeandroidsupportplugin.h | 12 +++++--- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.cpp b/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.cpp index d9b7566991a..dc9bf1c5f04 100644 --- a/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.cpp +++ b/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.cpp @@ -30,33 +30,30 @@ #include "qmakeandroidrunfactories.h" #include "qmakeandroidsupport.h" -#include +namespace QmakeAndroidSupport { +namespace Internal { -#include - -using namespace QmakeAndroidSupport::Internal; -using namespace QmakeAndroidSupport; - -QmakeAndroidSupportPlugin::QmakeAndroidSupportPlugin() +class QmakeAndroidSupportPluginPrivate { - -} +public: + AndroidQmakeBuildConfigurationFactory buildConfigFactory; + QmakeAndroidBuildApkStepFactory buildApkStepFactory; + QmakeAndroidRunConfigurationFactory runConfigFactory; + QmakeAndroidSupport androidSupport; +}; QmakeAndroidSupportPlugin::~QmakeAndroidSupportPlugin() { + delete d; } bool QmakeAndroidSupportPlugin::initialize(const QStringList &arguments, QString *errorMessage) { Q_UNUSED(arguments) Q_UNUSED(errorMessage) - addAutoReleasedObject(new AndroidQmakeBuildConfigurationFactory); - addAutoReleasedObject(new QmakeAndroidBuildApkStepFactory); - addAutoReleasedObject(new QmakeAndroidRunConfigurationFactory); - addAutoReleasedObject(new QmakeAndroidSupport); - + d = new QmakeAndroidSupportPluginPrivate; return true; } -void QmakeAndroidSupportPlugin::extensionsInitialized() -{ } +} // Internal +} // QmakeAndroidSupport diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.h b/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.h index e2f8be83b24..9383d1aceef 100644 --- a/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.h +++ b/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.h @@ -36,10 +36,14 @@ class QmakeAndroidSupportPlugin : public ExtensionSystem::IPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmakeAndroidSupport.json") public: - QmakeAndroidSupportPlugin(); - ~QmakeAndroidSupportPlugin(); - bool initialize(const QStringList &arguments, QString *errorMessage); - void extensionsInitialized(); + QmakeAndroidSupportPlugin() = default; + ~QmakeAndroidSupportPlugin() final; + +private: + bool initialize(const QStringList &arguments, QString *errorMessage) final; + void extensionsInitialized() final {} + + class QmakeAndroidSupportPluginPrivate *d = nullptr; }; } // namespace Internal