forked from qt-creator/qt-creator
Enable restoring the default names of project configuration items
* Enable support for this in all ProjectConfiguration items (Targets, projects, BCs, DCs, RCs, etc.). This is nicer than having custom code in individual configuraiton items. Reviewed-by: dt
This commit is contained in:
@@ -327,16 +327,18 @@ void BuildSettingsWidget::renameConfiguration()
|
||||
arg(m_buildConfiguration->displayName()),
|
||||
QLineEdit::Normal,
|
||||
m_buildConfiguration->displayName(), &ok);
|
||||
if (!ok || !this || name.isEmpty())
|
||||
if (!ok || !this)
|
||||
return;
|
||||
|
||||
QStringList bcNames;
|
||||
foreach (BuildConfiguration *bc, m_target->buildConfigurations()) {
|
||||
if (bc == m_buildConfiguration)
|
||||
continue;
|
||||
bcNames.append(bc->displayName());
|
||||
if (!name.isEmpty()) {
|
||||
QStringList bcNames;
|
||||
foreach (BuildConfiguration *bc, m_target->buildConfigurations()) {
|
||||
if (bc == m_buildConfiguration)
|
||||
continue;
|
||||
bcNames.append(bc->displayName());
|
||||
}
|
||||
name = Project::makeUnique(name, bcNames);
|
||||
}
|
||||
name = Project::makeUnique(name, bcNames);
|
||||
m_buildConfiguration->setDisplayName(name);
|
||||
|
||||
}
|
||||
@@ -347,15 +349,11 @@ void BuildSettingsWidget::cloneConfiguration(BuildConfiguration *sourceConfigura
|
||||
!m_target->buildConfigurationFactory())
|
||||
return;
|
||||
|
||||
//: Title of a the cloned BuildConfiguration window, text of the window
|
||||
QString newDisplayName(QInputDialog::getText(this, tr("Clone configuration"), tr("New Configuration Name:")));
|
||||
if (newDisplayName.isEmpty())
|
||||
return;
|
||||
|
||||
QStringList buildConfigurationDisplayNames;
|
||||
foreach(BuildConfiguration *bc, m_target->buildConfigurations())
|
||||
buildConfigurationDisplayNames << bc->displayName();
|
||||
newDisplayName = Project::makeUnique(newDisplayName, buildConfigurationDisplayNames);
|
||||
|
||||
BuildConfiguration * bc(m_target->buildConfigurationFactory()->clone(m_target, sourceConfiguration));
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user