forked from qt-creator/qt-creator
ProjectExplorer: Fix name not queried on adding new build configuration
BuildSettingsWidget::createConfiguration() works with a BuildInfo object borrowed from an IBuildConfigurationFactory, and uses it to create a new build configuration. The original BuildInfo object should not be permanently changed, as it's only used here for creating the new build configuration. Ideally, it should work on a clone of the buildinfo/factory, but that would require adding and implementing a polymorphic clone method for either class. This commit works around this problem by restoring the original displayName of the buildinfo after use. Task-number: QTCREATORBUG-12955 Change-Id: Iccf2123c4377a39396860a1cfaa817a98dacebd4 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
committed by
Daniel Teske
parent
e3bc7d19cf
commit
7ec74147a8
@@ -238,6 +238,7 @@ void BuildSettingsWidget::createConfiguration()
|
||||
{
|
||||
QAction *action = qobject_cast<QAction *>(sender());
|
||||
BuildInfo *info = static_cast<BuildInfo *>(action->data().value<void*>());
|
||||
QString originalDisplayName = info->displayName;
|
||||
|
||||
if (info->displayName.isEmpty()) {
|
||||
bool ok = false;
|
||||
@@ -256,6 +257,7 @@ void BuildSettingsWidget::createConfiguration()
|
||||
|
||||
m_target->addBuildConfiguration(bc);
|
||||
m_target->setActiveBuildConfiguration(bc);
|
||||
info->displayName = originalDisplayName;
|
||||
}
|
||||
|
||||
void BuildSettingsWidget::cloneConfiguration()
|
||||
|
||||
Reference in New Issue
Block a user