Commit def3dd1c authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Make sure newly added RunConfigurations have unique names

parent 3fcceedd
......@@ -164,8 +164,8 @@ void Target::addDeployConfiguration(DeployConfiguration *dc)
// Check that we don't have a configuration with the same displayName
QString configurationDisplayName = dc->displayName();
QStringList displayNames;
foreach (const DeployConfiguration *bc, m_deployConfigurations)
displayNames << bc->displayName();
foreach (const DeployConfiguration *current, m_deployConfigurations)
displayNames << current->displayName();
configurationDisplayName = Project::makeUnique(configurationDisplayName, displayNames);
dc->setDisplayName(configurationDisplayName);
......@@ -229,6 +229,14 @@ void Target::addRunConfiguration(RunConfiguration* runConfiguration)
QTC_ASSERT(runConfiguration && !m_runConfigurations.contains(runConfiguration), return);
Q_ASSERT(runConfiguration->target() == this);
// Check that we don't have a configuration with the same displayName
QString configurationDisplayName = runConfiguration->displayName();
QStringList displayNames;
foreach (const RunConfiguration *rc, m_runConfigurations)
displayNames << rc->displayName();
configurationDisplayName = Project::makeUnique(configurationDisplayName, displayNames);
runConfiguration->setDisplayName(configurationDisplayName);
m_runConfigurations.push_back(runConfiguration);
emit addedRunConfiguration(runConfiguration);
......
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