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();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidConfigurations::AndroidConfigurations(QObject *parent)
|
AndroidConfigurations::AndroidConfigurations()
|
||||||
: QObject(parent),
|
: m_sdkManager(new AndroidSdkManager(m_config))
|
||||||
m_sdkManager(new AndroidSdkManager(m_config))
|
|
||||||
{
|
{
|
||||||
load();
|
load();
|
||||||
|
|
||||||
|
|||||||
@@ -50,11 +50,10 @@ class Abi;
|
|||||||
class Project;
|
class Project;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Utils { class Environment; }
|
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
|
|
||||||
class AndroidPlugin;
|
class AndroidPluginRunData;
|
||||||
|
|
||||||
namespace Internal { class AndroidSdkManager; }
|
namespace Internal { class AndroidSdkManager; }
|
||||||
|
|
||||||
class AndroidDeviceInfo
|
class AndroidDeviceInfo
|
||||||
@@ -188,7 +187,6 @@ private:
|
|||||||
|
|
||||||
class ANDROID_EXPORT AndroidConfigurations : public QObject
|
class ANDROID_EXPORT AndroidConfigurations : public QObject
|
||||||
{
|
{
|
||||||
friend class Android::AndroidPlugin;
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -212,7 +210,8 @@ signals:
|
|||||||
void updated();
|
void updated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AndroidConfigurations(QObject *parent);
|
friend class Android::AndroidPluginRunData;
|
||||||
|
AndroidConfigurations();
|
||||||
~AndroidConfigurations();
|
~AndroidConfigurations();
|
||||||
void load();
|
void load();
|
||||||
void save();
|
void save();
|
||||||
|
|||||||
@@ -35,8 +35,7 @@
|
|||||||
using namespace Android;
|
using namespace Android;
|
||||||
using namespace Android::Internal;
|
using namespace Android::Internal;
|
||||||
|
|
||||||
AndroidManifestEditorFactory::AndroidManifestEditorFactory(QObject *parent)
|
AndroidManifestEditorFactory::AndroidManifestEditorFactory()
|
||||||
: Core::IEditorFactory(parent)
|
|
||||||
{
|
{
|
||||||
setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
|
setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
|
||||||
setDisplayName(tr("Android Manifest editor"));
|
setDisplayName(tr("Android Manifest editor"));
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class AndroidManifestEditorFactory : public Core::IEditorFactory
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AndroidManifestEditorFactory(QObject *parent = 0);
|
AndroidManifestEditorFactory();
|
||||||
|
|
||||||
Core::IEditor *createEditor();
|
Core::IEditor *createEditor();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,11 +31,12 @@
|
|||||||
#include <projectexplorer/abstractprocessstep.h>
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
|
namespace Internal { class AndroidPackageInstallationFactory; }
|
||||||
|
|
||||||
class ANDROID_EXPORT AndroidPackageInstallationStep : public ProjectExplorer::AbstractProcessStep
|
class ANDROID_EXPORT AndroidPackageInstallationStep : public ProjectExplorer::AbstractProcessStep
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class AndroidPackageInstallationFactory;
|
friend class Internal::AndroidPackageInstallationFactory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl);
|
explicit AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl);
|
||||||
|
|||||||
@@ -49,24 +49,41 @@
|
|||||||
# include "androidqbspropertyprovider.h"
|
# include "androidqbspropertyprovider.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
|
|
||||||
#include <qtsupport/qtversionmanager.h>
|
#include <qtsupport/qtversionmanager.h>
|
||||||
|
|
||||||
#include <QtPlugin>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace ProjectExplorer::Constants;
|
using namespace ProjectExplorer::Constants;
|
||||||
using namespace Android::Internal;
|
using namespace Android::Internal;
|
||||||
|
|
||||||
namespace Android {
|
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()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
AndroidPlugin::~AndroidPlugin()
|
||||||
|
{
|
||||||
|
delete m_runData;
|
||||||
|
}
|
||||||
|
|
||||||
bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_UNUSED(arguments);
|
Q_UNUSED(arguments);
|
||||||
@@ -79,21 +96,10 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa
|
|||||||
RunControl::registerWorker<AndroidRunConfiguration, AndroidQmlToolingSupport>(
|
RunControl::registerWorker<AndroidRunConfiguration, AndroidQmlToolingSupport>(
|
||||||
QML_PREVIEW_RUN_MODE);
|
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);
|
KitManager::registerKitInformation(new Internal::AndroidGdbServerKitInformation);
|
||||||
|
|
||||||
addAutoReleasedObject(new Internal::AndroidManifestEditorFactory);
|
|
||||||
|
|
||||||
connect(KitManager::instance(), &KitManager::kitsLoaded,
|
connect(KitManager::instance(), &KitManager::kitsLoaded,
|
||||||
this, &AndroidPlugin::kitsRestored);
|
this, &AndroidPlugin::kitsRestored);
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
|
|
||||||
|
class AndroidPluginRunData;
|
||||||
|
|
||||||
class AndroidPlugin : public ExtensionSystem::IPlugin
|
class AndroidPlugin : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -37,12 +39,16 @@ class AndroidPlugin : public ExtensionSystem::IPlugin
|
|||||||
public:
|
public:
|
||||||
AndroidPlugin();
|
AndroidPlugin();
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *errorMessage);
|
|
||||||
void extensionsInitialized() { }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
~AndroidPlugin() final;
|
||||||
|
|
||||||
|
bool initialize(const QStringList &arguments, QString *errorMessage) final;
|
||||||
|
void extensionsInitialized() final { }
|
||||||
|
|
||||||
void updateDevice();
|
void updateDevice();
|
||||||
void kitsRestored();
|
void kitsRestored();
|
||||||
|
|
||||||
|
AndroidPluginRunData *m_runData = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Android
|
} // namespace Android
|
||||||
|
|||||||
Reference in New Issue
Block a user