forked from qt-creator/qt-creator
MiniTargetSelector: Reset current item after display name changes
Taking a item out of the list and reinserting it changes the current item, so we need to set it again. Change-Id: Iefcf5adc7a22d9d8b799963a584d496067f233f3 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -385,6 +385,10 @@ void GenericListWidget::rowChanged(int index)
|
|||||||
void GenericListWidget::displayNameChanged()
|
void GenericListWidget::displayNameChanged()
|
||||||
{
|
{
|
||||||
m_ignoreIndexChange = true;
|
m_ignoreIndexChange = true;
|
||||||
|
ProjectConfiguration *activeProjectConfiguration = 0;
|
||||||
|
if (currentItem())
|
||||||
|
activeProjectConfiguration = currentItem()->data(Qt::UserRole).value<ProjectConfiguration *>();
|
||||||
|
|
||||||
ProjectConfiguration *pc = qobject_cast<ProjectConfiguration *>(sender());
|
ProjectConfiguration *pc = qobject_cast<ProjectConfiguration *>(sender());
|
||||||
int index = -1;
|
int index = -1;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -408,6 +412,8 @@ void GenericListWidget::displayNameChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
insertItem(pos, lwi);
|
insertItem(pos, lwi);
|
||||||
|
if (activeProjectConfiguration)
|
||||||
|
setCurrentItem(itemForProjectConfiguration(activeProjectConfiguration));
|
||||||
m_ignoreIndexChange = false;
|
m_ignoreIndexChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user