forked from qt-creator/qt-creator
Android: Remove dependency on plugin object pool
Change-Id: Ic6908cca581a0d6155c8c43c86163347ca578a4c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -1138,9 +1138,8 @@ void AndroidConfigurations::save()
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
AndroidConfigurations::AndroidConfigurations(QObject *parent)
|
||||
: QObject(parent),
|
||||
m_sdkManager(new AndroidSdkManager(m_config))
|
||||
AndroidConfigurations::AndroidConfigurations()
|
||||
: m_sdkManager(new AndroidSdkManager(m_config))
|
||||
{
|
||||
load();
|
||||
|
||||
|
||||
@@ -50,11 +50,10 @@ class Abi;
|
||||
class Project;
|
||||
}
|
||||
|
||||
namespace Utils { class Environment; }
|
||||
|
||||
namespace Android {
|
||||
|
||||
class AndroidPlugin;
|
||||
class AndroidPluginRunData;
|
||||
|
||||
namespace Internal { class AndroidSdkManager; }
|
||||
|
||||
class AndroidDeviceInfo
|
||||
@@ -188,7 +187,6 @@ private:
|
||||
|
||||
class ANDROID_EXPORT AndroidConfigurations : public QObject
|
||||
{
|
||||
friend class Android::AndroidPlugin;
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -212,7 +210,8 @@ signals:
|
||||
void updated();
|
||||
|
||||
private:
|
||||
AndroidConfigurations(QObject *parent);
|
||||
friend class Android::AndroidPluginRunData;
|
||||
AndroidConfigurations();
|
||||
~AndroidConfigurations();
|
||||
void load();
|
||||
void save();
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
using namespace Android;
|
||||
using namespace Android::Internal;
|
||||
|
||||
AndroidManifestEditorFactory::AndroidManifestEditorFactory(QObject *parent)
|
||||
: Core::IEditorFactory(parent)
|
||||
AndroidManifestEditorFactory::AndroidManifestEditorFactory()
|
||||
{
|
||||
setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
|
||||
setDisplayName(tr("Android Manifest editor"));
|
||||
|
||||
@@ -35,7 +35,7 @@ class AndroidManifestEditorFactory : public Core::IEditorFactory
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AndroidManifestEditorFactory(QObject *parent = 0);
|
||||
AndroidManifestEditorFactory();
|
||||
|
||||
Core::IEditor *createEditor();
|
||||
};
|
||||
|
||||
@@ -31,11 +31,12 @@
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
|
||||
namespace Android {
|
||||
namespace Internal { class AndroidPackageInstallationFactory; }
|
||||
|
||||
class ANDROID_EXPORT AndroidPackageInstallationStep : public ProjectExplorer::AbstractProcessStep
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class AndroidPackageInstallationFactory;
|
||||
friend class Internal::AndroidPackageInstallationFactory;
|
||||
|
||||
public:
|
||||
explicit AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl);
|
||||
|
||||
@@ -49,24 +49,41 @@
|
||||
# include "androidqbspropertyprovider.h"
|
||||
#endif
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Constants;
|
||||
using namespace Android::Internal;
|
||||
|
||||
namespace Android {
|
||||
|
||||
class AndroidPluginRunData
|
||||
{
|
||||
public:
|
||||
AndroidConfigurations androidConfiguration;
|
||||
AndroidSettingsPage settingsPage;
|
||||
AndroidDeployQtStepFactory deployQtStepFactory;
|
||||
AndroidQtVersionFactory qtVersionFactory;
|
||||
AndroidToolChainFactory toolChainFactory;
|
||||
AndroidDeployConfigurationFactory deployConfigurationFactory;
|
||||
AndroidDeviceFactory deviceFactory;
|
||||
AndroidPotentialKit potentialKit;
|
||||
JavaEditorFactory javaEditorFactory;
|
||||
AndroidPackageInstallationFactory packackeInstallationFactory;
|
||||
AndroidManifestEditorFactory manifestEditorFactory;
|
||||
};
|
||||
|
||||
AndroidPlugin::AndroidPlugin()
|
||||
{ }
|
||||
|
||||
AndroidPlugin::~AndroidPlugin()
|
||||
{
|
||||
delete m_runData;
|
||||
}
|
||||
|
||||
bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(arguments);
|
||||
@@ -79,21 +96,10 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa
|
||||
RunControl::registerWorker<AndroidRunConfiguration, AndroidQmlToolingSupport>(
|
||||
QML_PREVIEW_RUN_MODE);
|
||||
|
||||
new AndroidConfigurations(this);
|
||||
m_runData = new AndroidPluginRunData;
|
||||
|
||||
addAutoReleasedObject(new Internal::AndroidDeployQtStepFactory);
|
||||
addAutoReleasedObject(new Internal::AndroidSettingsPage);
|
||||
addAutoReleasedObject(new Internal::AndroidQtVersionFactory);
|
||||
addAutoReleasedObject(new Internal::AndroidToolChainFactory);
|
||||
addAutoReleasedObject(new Internal::AndroidDeployConfigurationFactory);
|
||||
addAutoReleasedObject(new Internal::AndroidDeviceFactory);
|
||||
addAutoReleasedObject(new Internal::AndroidPotentialKit);
|
||||
addAutoReleasedObject(new Internal::JavaEditorFactory);
|
||||
addAutoReleasedObject(new Internal::AndroidPackageInstallationFactory);
|
||||
KitManager::registerKitInformation(new Internal::AndroidGdbServerKitInformation);
|
||||
|
||||
addAutoReleasedObject(new Internal::AndroidManifestEditorFactory);
|
||||
|
||||
connect(KitManager::instance(), &KitManager::kitsLoaded,
|
||||
this, &AndroidPlugin::kitsRestored);
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
namespace Android {
|
||||
|
||||
class AndroidPluginRunData;
|
||||
|
||||
class AndroidPlugin : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -37,12 +39,16 @@ class AndroidPlugin : public ExtensionSystem::IPlugin
|
||||
public:
|
||||
AndroidPlugin();
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage);
|
||||
void extensionsInitialized() { }
|
||||
|
||||
private:
|
||||
~AndroidPlugin() final;
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage) final;
|
||||
void extensionsInitialized() final { }
|
||||
|
||||
void updateDevice();
|
||||
void kitsRestored();
|
||||
|
||||
AndroidPluginRunData *m_runData = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Android
|
||||
|
||||
Reference in New Issue
Block a user