diff --git a/src/plugins/projectexplorer/abiwidget.cpp b/src/plugins/projectexplorer/abiwidget.cpp index 7fa8f432cbb..592e5ddc4f9 100644 --- a/src/plugins/projectexplorer/abiwidget.cpp +++ b/src/plugins/projectexplorer/abiwidget.cpp @@ -148,7 +148,15 @@ void AbiWidget::setAbis(const QList &abiList, const Abi ¤t) bool blocked = blockSignals(true); d->m_abi->clear(); - d->m_abi->addItem(tr(""), QLatin1String("custom")); + Abi defaultAbi = current; + if (defaultAbi.isNull()) { + if (!abiList.isEmpty()) + defaultAbi = abiList.at(0); + else + defaultAbi = Abi::hostAbi(); + } + + d->m_abi->addItem(tr(""), defaultAbi.toString()); d->m_abi->setCurrentIndex(0); for (int i = 0; i < abiList.count(); ++i) { @@ -198,10 +206,8 @@ void AbiWidget::modeChanged() d->m_binaryFormatComboBox->setEnabled(customMode); d->m_wordWidthComboBox->setEnabled(customMode); - if (!customMode) { - Abi current(d->m_abi->itemData(d->m_abi->currentIndex()).toString()); - setCustomAbi(current); - } + Abi current(d->m_abi->itemData(d->m_abi->currentIndex()).toString()); + setCustomAbi(current); } void AbiWidget::customAbiChanged() @@ -238,7 +244,8 @@ void AbiWidget::setCustomAbi(const Abi ¤t) break; } } - d->m_abi->setItemData(0, current.toString()); + if (d->m_abi->currentIndex() == 0) + d->m_abi->setItemData(0, current.toString()); blockSignals(blocked); emit abiChanged();