forked from qt-creator/qt-creator
WinRt: Avoid use of global object pool
Change-Id: I875122569f4e78750993caa11b8635b68d0fc8da Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -34,38 +34,44 @@
|
||||
#include "winrtruncontrol.h"
|
||||
#include "winrtdebugsupport.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QSysInfo>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace WinRt {
|
||||
namespace Internal {
|
||||
|
||||
class WinRtPluginRunData
|
||||
{
|
||||
public:
|
||||
WinRtRunConfigurationFactory runConfigFactory;
|
||||
WinRtQtVersionFactory qtVersionFactory;
|
||||
WinRtAppDeployConfigurationFactory appDeployConfigFactory;
|
||||
WinRtPhoneDeployConfigurationFactory phoneDeployConfigFactory;
|
||||
WinRtEmulatorDeployConfigurationFactory emulatorDeployFactory;
|
||||
WinRtDeployStepFactory deployStepFactory;
|
||||
WinRtDeviceFactory deviceFactory;
|
||||
};
|
||||
|
||||
WinRtPlugin::WinRtPlugin()
|
||||
{
|
||||
setObjectName(QLatin1String("WinRtPlugin"));
|
||||
}
|
||||
|
||||
WinRtPlugin::~WinRtPlugin()
|
||||
{
|
||||
delete m_runData;
|
||||
}
|
||||
|
||||
bool WinRtPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorMessage)
|
||||
|
||||
addAutoReleasedObject(new Internal::WinRtRunConfigurationFactory);
|
||||
addAutoReleasedObject(new Internal::WinRtQtVersionFactory);
|
||||
addAutoReleasedObject(new Internal::WinRtAppDeployConfigurationFactory);
|
||||
addAutoReleasedObject(new Internal::WinRtPhoneDeployConfigurationFactory);
|
||||
addAutoReleasedObject(new Internal::WinRtEmulatorDeployConfigurationFactory);
|
||||
addAutoReleasedObject(new Internal::WinRtDeployStepFactory);
|
||||
m_runData = new WinRtPluginRunData;
|
||||
|
||||
auto runConstraint = [](RunConfiguration *runConfig) {
|
||||
IDevice::ConstPtr device = DeviceKitInformation::device(runConfig->target()->kit());
|
||||
@@ -91,10 +97,5 @@ bool WinRtPlugin::initialize(const QStringList &arguments, QString *errorMessage
|
||||
return true;
|
||||
}
|
||||
|
||||
void WinRtPlugin::extensionsInitialized()
|
||||
{
|
||||
addAutoReleasedObject(new Internal::WinRtDeviceFactory);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace WinRt
|
||||
|
@@ -30,7 +30,7 @@
|
||||
namespace WinRt {
|
||||
namespace Internal {
|
||||
|
||||
class WinRtDeviceFactory;
|
||||
class WinRtPluginRunData;
|
||||
|
||||
class WinRtPlugin : public ExtensionSystem::IPlugin
|
||||
{
|
||||
@@ -39,9 +39,13 @@ class WinRtPlugin : public ExtensionSystem::IPlugin
|
||||
|
||||
public:
|
||||
WinRtPlugin();
|
||||
~WinRtPlugin() final;
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage);
|
||||
void extensionsInitialized();
|
||||
private:
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage) final;
|
||||
void extensionsInitialized() final {}
|
||||
|
||||
WinRtPluginRunData *m_runData = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user