aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ios/iosplugin.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2018-02-08 09:24:22 +0100
committerhjk <[email protected]>2018-02-14 12:43:56 +0000
commit65078befcea0df7669a224405b63be3a148080e6 (patch)
tree0009b59ce23743e1c8b768f0782c2cd4cf2936b5 /src/plugins/ios/iosplugin.cpp
parent6a964d8d0b098d0b9f9ae2ece9c1194b103b0318 (diff)
IosPlugin: Pimpl plugin class
Also generally follow the current plugin setup pattern, remove unneeded uses of global plugin pool, move stuff to the usual initialization phases. Change-Id: I1eb1d8251be68aa095e07125d42451dae4a3dd06 Reviewed-by: Vikas Pachdha <[email protected]>
Diffstat (limited to 'src/plugins/ios/iosplugin.cpp')
-rw-r--r--src/plugins/ios/iosplugin.cpp63
1 files changed, 33 insertions, 30 deletions
diff --git a/src/plugins/ios/iosplugin.cpp b/src/plugins/ios/iosplugin.cpp
index 1841ed73a65..0f96241792a 100644
--- a/src/plugins/ios/iosplugin.cpp
+++ b/src/plugins/ios/iosplugin.cpp
@@ -48,18 +48,33 @@
#include <qtsupport/qtversionmanager.h>
-#include <QtPlugin>
-
using namespace ProjectExplorer;
+using namespace QtSupport;
namespace Ios {
namespace Internal {
+
Q_LOGGING_CATEGORY(iosLog, "qtc.ios.common")
-}
-IosPlugin::IosPlugin()
+class IosPluginPrivate
{
- qRegisterMetaType<Ios::IosToolHandler::Dict>("Ios::IosToolHandler::Dict");
+public:
+ IosBuildConfigurationFactory buildConfigurationFactory;
+ IosToolChainFactory toolChainFactory;
+ IosRunConfigurationFactory runConfigurationFactory;
+ IosSettingsPage settingsPage;
+ IosQtVersionFactory qtVersionFactory;
+ IosDeviceFactory deviceFactory;
+ IosSimulatorFactory simulatorFactory;
+ IosBuildStepFactory buildStepFactory;
+ IosDeployStepFactory deployStepFactory;
+ IosDsymBuildStepFactory dsymBuildStepFactory;
+ IosDeployConfigurationFactory deployConfigurationFactory;
+};
+
+IosPlugin::~IosPlugin()
+{
+ delete d;
}
bool IosPlugin::initialize(const QStringList &arguments, QString *errorMessage)
@@ -67,22 +82,14 @@ bool IosPlugin::initialize(const QStringList &arguments, QString *errorMessage)
Q_UNUSED(arguments);
Q_UNUSED(errorMessage);
- Internal::IosConfigurations::initialize();
+ qRegisterMetaType<Ios::IosToolHandler::Dict>("Ios::IosToolHandler::Dict");
+
+ IosConfigurations::initialize();
- addAutoReleasedObject(new Internal::IosBuildConfigurationFactory);
- addAutoReleasedObject(new Internal::IosToolChainFactory);
- addAutoReleasedObject(new Internal::IosRunConfigurationFactory);
- addAutoReleasedObject(new Internal::IosSettingsPage);
- addAutoReleasedObject(new Internal::IosQtVersionFactory);
- addAutoReleasedObject(new Internal::IosDeviceFactory);
- addAutoReleasedObject(new Internal::IosSimulatorFactory);
- addAutoReleasedObject(new Internal::IosBuildStepFactory);
- addAutoReleasedObject(new Internal::IosDeployStepFactory);
- addAutoReleasedObject(new Internal::IosDsymBuildStepFactory);
- addAutoReleasedObject(new Internal::IosDeployConfigurationFactory);
+ d = new IosPluginPrivate;
auto constraint = [](RunConfiguration *runConfig) {
- return qobject_cast<Internal::IosRunConfiguration *>(runConfig) != nullptr;
+ return qobject_cast<IosRunConfiguration *>(runConfig) != nullptr;
};
RunControl::registerWorker<Internal::IosRunSupport>
@@ -92,24 +99,20 @@ bool IosPlugin::initialize(const QStringList &arguments, QString *errorMessage)
RunControl::registerWorker<Internal::IosQmlProfilerSupport>
(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, constraint);
- return true;
-}
-
-void IosPlugin::extensionsInitialized()
-{
- connect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::kitsLoaded,
+ connect(KitManager::instance(), &KitManager::kitsLoaded,
this, &IosPlugin::kitsRestored);
+
+ return true;
}
void IosPlugin::kitsRestored()
{
- disconnect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::kitsLoaded,
+ disconnect(KitManager::instance(), &KitManager::kitsLoaded,
this, &IosPlugin::kitsRestored);
- Internal::IosConfigurations::updateAutomaticKitList();
- connect(QtSupport::QtVersionManager::instance(),
- &QtSupport::QtVersionManager::qtVersionsChanged,
- Internal::IosConfigurations::instance(),
- &Internal::IosConfigurations::updateAutomaticKitList);
+ IosConfigurations::updateAutomaticKitList();
+ connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged,
+ IosConfigurations::instance(), &IosConfigurations::updateAutomaticKitList);
}
+} // namespace Internal
} // namespace Ios