diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 509caab5bbd..5796800951d 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -42,16 +42,16 @@ #include "tarpackagecreationstep.h" #include "uploadandinstalltarpackagestep.h" -#include +using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { template -class GenericLinuxDeployStepFactory : public ProjectExplorer::BuildStepFactory +class GenericDeployStepFactory : public ProjectExplorer::BuildStepFactory { public: - GenericLinuxDeployStepFactory() + GenericDeployStepFactory() { registerStep(Step::stepId()); setDisplayName(Step::displayName()); @@ -60,19 +60,43 @@ public: } }; +class RemoteLinuxPluginPrivate +{ +public: + GenericLinuxDeviceConfigurationFactory deviceConfigurationFactory; + RemoteLinuxRunConfigurationFactory runConfigurationFactory; + RemoteLinuxCustomRunConfigurationFactory customRunConfigurationFactory; + RemoteLinuxDeployConfigurationFactory deployConfigurationFactory; + GenericDeployStepFactory tarPackageCreationStepFactory; + GenericDeployStepFactory uploadAndInstallTarPackageStepFactory; + GenericDeployStepFactory genericDirectUploadStepFactory; + GenericDeployStepFactory + customCommandDeploymentStepFactory; + GenericDeployStepFactory + checkForFreeDiskSpaceStepFactory; + GenericDeployStepFactory remoteLinuxKillAppStepFactory; + EmbeddedLinuxQtVersionFactory embeddedLinuxQtVersionFactory; +}; + +static RemoteLinuxPluginPrivate *dd = nullptr; + RemoteLinuxPlugin::RemoteLinuxPlugin() { setObjectName(QLatin1String("RemoteLinuxPlugin")); } +RemoteLinuxPlugin::~RemoteLinuxPlugin() +{ + delete dd; +} + bool RemoteLinuxPlugin::initialize(const QStringList &arguments, QString *errorMessage) { Q_UNUSED(arguments) Q_UNUSED(errorMessage) - using namespace ProjectExplorer; - using namespace ProjectExplorer::Constants; + dd = new RemoteLinuxPluginPrivate; auto constraint = [](RunConfiguration *runConfig) { const Core::Id id = runConfig->id(); @@ -80,35 +104,14 @@ bool RemoteLinuxPlugin::initialize(const QStringList &arguments, || id.name().startsWith(RemoteLinuxRunConfiguration::IdPrefix); }; + using namespace ProjectExplorer::Constants; RunControl::registerWorker(NORMAL_RUN_MODE, constraint); RunControl::registerWorker(DEBUG_RUN_MODE, constraint); RunControl::registerWorker(QML_PROFILER_RUN_MODE, constraint); RunControl::registerWorker(QML_PREVIEW_RUN_MODE, constraint); - addAutoReleasedObject(new GenericLinuxDeviceConfigurationFactory); - addAutoReleasedObject(new RemoteLinuxRunConfigurationFactory); - addAutoReleasedObject(new RemoteLinuxCustomRunConfigurationFactory); - addAutoReleasedObject(new RemoteLinuxDeployConfigurationFactory); - addAutoReleasedObject(new GenericLinuxDeployStepFactory); - addAutoReleasedObject(new GenericLinuxDeployStepFactory); - addAutoReleasedObject(new GenericLinuxDeployStepFactory); - addAutoReleasedObject(new GenericLinuxDeployStepFactory - ); - addAutoReleasedObject(new GenericLinuxDeployStepFactory); - addAutoReleasedObject(new GenericLinuxDeployStepFactory); - - addAutoReleasedObject(new EmbeddedLinuxQtVersionFactory); - return true; } -RemoteLinuxPlugin::~RemoteLinuxPlugin() -{ -} - -void RemoteLinuxPlugin::extensionsInitialized() -{ -} - } // namespace Internal } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinuxplugin.h b/src/plugins/remotelinux/remotelinuxplugin.h index aa35482d2fe..12227081606 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.h +++ b/src/plugins/remotelinux/remotelinuxplugin.h @@ -37,10 +37,11 @@ class RemoteLinuxPlugin : public ExtensionSystem::IPlugin public: RemoteLinuxPlugin(); - ~RemoteLinuxPlugin(); + ~RemoteLinuxPlugin() final; - bool initialize(const QStringList &arguments, QString *errorMessage); - void extensionsInitialized(); +private: + bool initialize(const QStringList &arguments, QString *errorMessage) final; + void extensionsInitialized() final {} }; } // namespace Internal