QmakeAndroidSupport: Pimpl and remove use of global object pool

Change-Id: I2b893ac8fd72d920a538739de2c0ccfa2a9ba354
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
hjk
2018-02-08 11:58:59 +01:00
parent 6445fb19bb
commit 24520b9159
2 changed files with 21 additions and 20 deletions

View File

@@ -30,33 +30,30 @@
#include "qmakeandroidrunfactories.h" #include "qmakeandroidrunfactories.h"
#include "qmakeandroidsupport.h" #include "qmakeandroidsupport.h"
#include <coreplugin/icore.h> namespace QmakeAndroidSupport {
namespace Internal {
#include <QtPlugin> class QmakeAndroidSupportPluginPrivate
using namespace QmakeAndroidSupport::Internal;
using namespace QmakeAndroidSupport;
QmakeAndroidSupportPlugin::QmakeAndroidSupportPlugin()
{ {
public:
} AndroidQmakeBuildConfigurationFactory buildConfigFactory;
QmakeAndroidBuildApkStepFactory buildApkStepFactory;
QmakeAndroidRunConfigurationFactory runConfigFactory;
QmakeAndroidSupport androidSupport;
};
QmakeAndroidSupportPlugin::~QmakeAndroidSupportPlugin() QmakeAndroidSupportPlugin::~QmakeAndroidSupportPlugin()
{ {
delete d;
} }
bool QmakeAndroidSupportPlugin::initialize(const QStringList &arguments, QString *errorMessage) bool QmakeAndroidSupportPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{ {
Q_UNUSED(arguments) Q_UNUSED(arguments)
Q_UNUSED(errorMessage) Q_UNUSED(errorMessage)
addAutoReleasedObject(new AndroidQmakeBuildConfigurationFactory); d = new QmakeAndroidSupportPluginPrivate;
addAutoReleasedObject(new QmakeAndroidBuildApkStepFactory);
addAutoReleasedObject(new QmakeAndroidRunConfigurationFactory);
addAutoReleasedObject(new QmakeAndroidSupport);
return true; return true;
} }
void QmakeAndroidSupportPlugin::extensionsInitialized() } // Internal
{ } } // QmakeAndroidSupport

View File

@@ -36,10 +36,14 @@ class QmakeAndroidSupportPlugin : public ExtensionSystem::IPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmakeAndroidSupport.json") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmakeAndroidSupport.json")
public: public:
QmakeAndroidSupportPlugin(); QmakeAndroidSupportPlugin() = default;
~QmakeAndroidSupportPlugin(); ~QmakeAndroidSupportPlugin() final;
bool initialize(const QStringList &arguments, QString *errorMessage);
void extensionsInitialized(); private:
bool initialize(const QStringList &arguments, QString *errorMessage) final;
void extensionsInitialized() final {}
class QmakeAndroidSupportPluginPrivate *d = nullptr;
}; };
} // namespace Internal } // namespace Internal