Commit 3061d7dc authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Check (build|run)configurations on addition

 * Make sure we do not add duplicate or 0 (build|run)configurations
   to a project.

Reviewed-by: dt
parent 95666a2e
......@@ -83,6 +83,8 @@ QString Project::makeUnique(const QString &preferredName, const QStringList &use
void Project::addBuildConfiguration(BuildConfiguration *configuration)
{
QTC_ASSERT(!configuration || m_buildConfigurations.contains(configuration), return);
// Check that we don't have a configuration with the same displayName
QString configurationDisplayName = configuration->displayName();
QStringList displayNames;
......@@ -413,10 +415,8 @@ QList<RunConfiguration *> Project::runConfigurations() const
void Project::addRunConfiguration(RunConfiguration* runConfiguration)
{
if (m_runConfigurations.contains(runConfiguration)) {
qWarning()<<"Not adding already existing runConfiguration"<<runConfiguration->displayName();
return;
}
QTC_ASSERT(!runConfiguration || m_runConfigurations.contains(runConfiguration), return);
m_runConfigurations.push_back(runConfiguration);
emit addedRunConfiguration(this, runConfiguration->displayName());
}
......
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