Use new DeployConfigurationFactory::addInitialStep in some cases

Less code, less classes.

Change-Id: I3ba9920f4f389e14c67cd8c5d937a4b4659865e7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-01-18 11:32:53 +01:00
parent 910496130c
commit 372fbf9c05
11 changed files with 35 additions and 62 deletions

View File

@@ -37,23 +37,14 @@ using namespace ProjectExplorer;
namespace Ios {
namespace Internal {
IosDeployConfiguration::IosDeployConfiguration(Target *parent, Core::Id id)
: DeployConfiguration(parent, id)
{
}
void IosDeployConfiguration::initialize()
{
stepList()->appendStep(new IosDeployStep(stepList()));
}
IosDeployConfigurationFactory::IosDeployConfigurationFactory()
{
registerDeployConfiguration<IosDeployConfiguration>("Qt4ProjectManager.IosDeployConfiguration");
registerDeployConfiguration<DeployConfiguration>("Qt4ProjectManager.IosDeployConfiguration");
setSupportedProjectType(QmakeProjectManager::Constants::QMAKEPROJECT_ID);
addSupportedTargetDeviceType(Constants::IOS_DEVICE_TYPE);
addSupportedTargetDeviceType(Constants::IOS_SIMULATOR_TYPE);
setDefaultDisplayName(IosDeployConfiguration::tr("Deploy on iOS"));
setDefaultDisplayName(QCoreApplication::translate("Ios::Internal", "Deploy on iOS"));
addInitialStep(IosDeployStep::stepId());
}
} // namespace Internal

View File

@@ -30,15 +30,6 @@
namespace Ios {
namespace Internal {
class IosDeployConfiguration : public ProjectExplorer::DeployConfiguration
{
Q_OBJECT
public:
IosDeployConfiguration(ProjectExplorer::Target *parent, Core::Id id);
void initialize() override;
};
class IosDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory
{
public:

View File

@@ -54,10 +54,8 @@ using namespace ProjectExplorer;
namespace Ios {
namespace Internal {
const Core::Id IosDeployStep::Id("Qt4ProjectManager.IosDeployStep");
IosDeployStep::IosDeployStep(BuildStepList *parent)
: BuildStep(parent, Id)
: BuildStep(parent, stepId())
{
setImmutable(true);
setRunInGuiThread(true);
@@ -68,6 +66,11 @@ IosDeployStep::IosDeployStep(BuildStepList *parent)
this, &IosDeployStep::updateDisplayNames);
}
Core::Id IosDeployStep::stepId()
{
return "Qt4ProjectManager.IosDeployStep";
}
void IosDeployStep::updateDisplayNames()
{
IDevice::ConstPtr dev =

View File

@@ -52,6 +52,7 @@ public:
friend class IosDeployStepFactory;
explicit IosDeployStep(ProjectExplorer::BuildStepList *bc);
static Core::Id stepId();
bool fromMap(const QVariantMap &map) override;
QVariantMap toMap() const override;

View File

@@ -35,7 +35,7 @@ namespace Internal {
IosDeployStepFactory::IosDeployStepFactory()
{
registerStep<IosDeployStep>(IosDeployStep::Id);
registerStep<IosDeployStep>(IosDeployStep::stepId());
setDisplayName(IosDeployStep::tr("Deploy to iOS device or emulator"));
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
setSupportedDeviceTypes({Constants::IOS_DEVICE_TYPE, Constants::IOS_SIMULATOR_TYPE});