Commit d7993c71 authored by Daniel Teske's avatar Daniel Teske Committed by Daniel Teske

Make DeployConfigurations cloneable

The API was there just not the correct implementation.

Change-Id: I65468f3c00f3c8ba1b853f8c11f6296813d1a966
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent a969c9c1
......@@ -57,6 +57,7 @@ AndroidDeployConfiguration::AndroidDeployConfiguration(Target *parent, Core::Id
AndroidDeployConfiguration::AndroidDeployConfiguration(Target *parent, DeployConfiguration *source)
: DeployConfiguration(parent, source)
{
cloneSteps(source);
}
AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory(QObject *parent)
......
......@@ -76,6 +76,7 @@ Qt4MaemoDeployConfiguration::Qt4MaemoDeployConfiguration(ProjectExplorer::Target
: RemoteLinuxDeployConfiguration(target, source)
{
init();
cloneSteps(source);
}
DeployConfigurationWidget *Qt4MaemoDeployConfiguration::configurationWidget() const
......
......@@ -150,6 +150,21 @@ void DeployConfiguration::cloneSteps(DeployConfiguration *source)
m_stepList->cloneSteps(source->stepList());
}
///
// DefaultDeployConfiguration
///
DefaultDeployConfiguration::DefaultDeployConfiguration(Target *target, const Core::Id id)
: DeployConfiguration(target, id)
{
}
DefaultDeployConfiguration::DefaultDeployConfiguration(Target *target, DeployConfiguration *source)
: DeployConfiguration(target, source)
{
cloneSteps(source);
}
///
// DeployConfigurationFactory
///
......@@ -187,7 +202,7 @@ DeployConfiguration *DeployConfigurationFactory::create(Target *parent, const Co
{
if (!canCreate(parent, id))
return 0;
return new DeployConfiguration(parent, id);
return new DefaultDeployConfiguration(parent, id);
}
bool DeployConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
......@@ -199,7 +214,7 @@ DeployConfiguration *DeployConfigurationFactory::restore(Target *parent, const Q
{
if (!canRestore(parent, map))
return 0;
DeployConfiguration *dc = new DeployConfiguration(parent, idFromMap(map));
DefaultDeployConfiguration *dc = new DefaultDeployConfiguration(parent, idFromMap(map));
if (!dc->fromMap(map)) {
delete dc;
return 0;
......@@ -216,7 +231,7 @@ DeployConfiguration *DeployConfigurationFactory::clone(Target *parent, DeployCon
{
if (!canClone(parent, product))
return 0;
return new DeployConfiguration(parent, product);
return new DefaultDeployConfiguration(parent, product);
}
DeployConfigurationFactory *DeployConfigurationFactory::find(Target *parent, const QVariantMap &map)
......
......@@ -78,11 +78,18 @@ protected:
bool fromMap(const QVariantMap &map);
private:
friend class DeployConfigurationFactory;
BuildStepList *m_stepList;
};
class PROJECTEXPLORER_EXPORT DefaultDeployConfiguration : public DeployConfiguration
{
Q_OBJECT
friend class DeployConfigurationFactory; // for the ctors
protected:
DefaultDeployConfiguration(Target *target, const Core::Id id);
DefaultDeployConfiguration(Target *target, DeployConfiguration *source);
};
class PROJECTEXPLORER_EXPORT DeployConfigurationFactory :
public QObject
{
......
......@@ -61,6 +61,7 @@ BlackBerryDeployConfiguration::BlackBerryDeployConfiguration(ProjectExplorer::Ta
: ProjectExplorer::DeployConfiguration(parent, source)
{
ctor();
cloneSteps(source);
}
void BlackBerryDeployConfiguration::ctor()
......
......@@ -44,4 +44,5 @@ QnxDeployConfiguration::QnxDeployConfiguration(ProjectExplorer::Target *target,
QnxDeployConfiguration::QnxDeployConfiguration(ProjectExplorer::Target *target, QnxDeployConfiguration *source)
: RemoteLinux::RemoteLinuxDeployConfiguration(target, source)
{
cloneSteps(source);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment