Commit a741261f authored by dt's avatar dt
Browse files

Fist set the display name then addBuildConfiguration on clone

parent a8c45054
......@@ -138,7 +138,6 @@ BuildConfiguration *CMakeBuildConfigurationFactory::clone(ProjectExplorer::Build
{
CMakeBuildConfiguration *old = static_cast<CMakeBuildConfiguration *>(source);
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(old);
m_project->addBuildConfiguration(bc);
return bc;
}
......
......@@ -159,7 +159,6 @@ BuildConfiguration *GenericBuildConfigurationFactory::create(const QString &type
BuildConfiguration *GenericBuildConfigurationFactory::clone(BuildConfiguration *source) const
{
GenericBuildConfiguration *bc = new GenericBuildConfiguration(static_cast<GenericBuildConfiguration *>(source));
m_project->addBuildConfiguration(bc);
return bc;
}
......
......@@ -114,7 +114,7 @@ public:
// project mode for editing
virtual BuildConfiguration *create(const QString &type) const = 0;
// clones a given BuildConfiguration and adds it to the project
// clones a given BuildConfiguration, should not add it to the project
virtual BuildConfiguration *clone(BuildConfiguration *source) const = 0;
// restores a BuildConfiguration with the name and adds it to the project
......
......@@ -339,6 +339,7 @@ void BuildSettingsWidget::cloneConfiguration(BuildConfiguration *sourceConfigura
m_buildConfiguration = m_project->buildConfigurationFactory()->clone(sourceConfiguration);
m_buildConfiguration->setDisplayName(newDisplayName);
m_project->addBuildConfiguration(m_buildConfiguration);
updateBuildSettings();
}
......
......@@ -298,7 +298,6 @@ BuildConfiguration *Qt4BuildConfigurationFactory::clone(BuildConfiguration *sour
{
Qt4BuildConfiguration *oldbc = static_cast<Qt4BuildConfiguration *>(source);
Qt4BuildConfiguration *newbc = new Qt4BuildConfiguration(oldbc);
m_project->addBuildConfiguration(newbc);
return newbc;
}
......
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