}
if (d->m_abi->currentIndex() == 0) {
- d->m_abi->setCurrentIndex(0);
- d->m_architectureComboBox->setCurrentIndex(static_cast<int>(current.architecture()));
- d->m_osComboBox->setCurrentIndex(static_cast<int>(current.os()));
- osChanged();
- for (int i = 0; i < d->m_osFlavorComboBox->count(); ++i) {
- if (d->m_osFlavorComboBox->itemData(i).toInt() == current.osFlavor()) {
- d->m_osFlavorComboBox->setCurrentIndex(i);
- break;
+ if (!current.isValid() && !abiList.isEmpty()) {
+ d->m_abi->setCurrentIndex(1); // default to the first Abi if none is selected.
+ } else {
+ d->m_architectureComboBox->setCurrentIndex(static_cast<int>(current.architecture()));
+ d->m_osComboBox->setCurrentIndex(static_cast<int>(current.os()));
+ osChanged();
+ for (int i = 0; i < d->m_osFlavorComboBox->count(); ++i) {
+ if (d->m_osFlavorComboBox->itemData(i).toInt() == current.osFlavor()) {
+ d->m_osFlavorComboBox->setCurrentIndex(i);
+ break;
+ }
}
- }
- d->m_binaryFormatComboBox->setCurrentIndex(static_cast<int>(current.binaryFormat()));
- for (int i = 0; i < d->m_wordWidthComboBox->count(); ++i) {
- if (d->m_wordWidthComboBox->itemData(i).toInt() == current.wordWidth()) {
- d->m_wordWidthComboBox->setCurrentIndex(i);
- break;
+ d->m_binaryFormatComboBox->setCurrentIndex(static_cast<int>(current.binaryFormat()));
+ for (int i = 0; i < d->m_wordWidthComboBox->count(); ++i) {
+ if (d->m_wordWidthComboBox->itemData(i).toInt() == current.wordWidth()) {
+ d->m_wordWidthComboBox->setCurrentIndex(i);
+ break;
+ }
}
}
}
connect(m_compilerPath, SIGNAL(changed(QString)), this, SLOT(handlePathChange()));
layout->addRow(tr("&Compiler path:"), m_compilerPath);
layout->addRow(tr("&ABI:"), m_abiWidget);
+ m_abiWidget->setEnabled(false);
addDebuggerCommandControls(layout, gnuVersionArgs);
addErrorLabel(layout);
- populateAbiList(tc->supportedAbis(), tc->targetAbi());
-
connect(m_abiWidget, SIGNAL(abiChanged()), this, SLOT(handleAbiChange()));
setFromToolchain();
m_autoDebuggerCommand = QLatin1String("<manually set>");
}
-void Internal::GccToolChainConfigWidget::populateAbiList(const QList<Abi> &list, const Abi ¤t)
-{
- m_abiWidget->setAbis(list, current);
- handleAbiChange();
-}
-
void Internal::GccToolChainConfigWidget::setFromToolchain()
{
+ blockSignals(true);
GccToolChain *tc = static_cast<GccToolChain *>(toolChain());
- Q_ASSERT(tc);
m_compilerPath->setPath(tc->compilerPath());
+ m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi());
setDebuggerCommand(tc->debuggerCommand());
- populateAbiList(tc->supportedAbis(), tc->targetAbi());
+ blockSignals(false);
}
bool Internal::GccToolChainConfigWidget::isDirty() const
{
QString path = m_compilerPath->path();
QList<Abi> abiList;
- if (QFileInfo(path).isExecutable())
+ bool haveCompiler = false;
+ if (!path.isEmpty()) {
+ QFileInfo fi(path);
+ haveCompiler = fi.isExecutable() && fi.isFile();
+ }
+ if (haveCompiler)
abiList = guessGccAbi(path, Utils::Environment::systemEnvironment().toStringList());
- populateAbiList(abiList, m_abiWidget->currentAbi());
- emit dirty(toolChain());
+ m_abiWidget->setEnabled(haveCompiler);
+ Abi currentAbi = m_abiWidget->currentAbi();
+ m_abiWidget->setAbis(abiList, abiList.contains(currentAbi) ? currentAbi : Abi());
+ handleAbiChange();
}
void Internal::GccToolChainConfigWidget::handleAbiChange()