forked from qt-creator/qt-creator
Check (build|run)configurations on addition
* Make sure we do not add duplicate or 0 (build|run)configurations to a project. Reviewed-by: dt
This commit is contained in:
@@ -83,6 +83,8 @@ QString Project::makeUnique(const QString &preferredName, const QStringList &use
|
|||||||
|
|
||||||
void Project::addBuildConfiguration(BuildConfiguration *configuration)
|
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
|
// Check that we don't have a configuration with the same displayName
|
||||||
QString configurationDisplayName = configuration->displayName();
|
QString configurationDisplayName = configuration->displayName();
|
||||||
QStringList displayNames;
|
QStringList displayNames;
|
||||||
@@ -413,10 +415,8 @@ QList<RunConfiguration *> Project::runConfigurations() const
|
|||||||
|
|
||||||
void Project::addRunConfiguration(RunConfiguration* runConfiguration)
|
void Project::addRunConfiguration(RunConfiguration* runConfiguration)
|
||||||
{
|
{
|
||||||
if (m_runConfigurations.contains(runConfiguration)) {
|
QTC_ASSERT(!runConfiguration || m_runConfigurations.contains(runConfiguration), return);
|
||||||
qWarning()<<"Not adding already existing runConfiguration"<<runConfiguration->displayName();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_runConfigurations.push_back(runConfiguration);
|
m_runConfigurations.push_back(runConfiguration);
|
||||||
emit addedRunConfiguration(this, runConfiguration->displayName());
|
emit addedRunConfiguration(this, runConfiguration->displayName());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user