Commit 48ebaf46 authored by hjk's avatar hjk
Browse files

ProjectExplorer: Make KitChooser usable with one kit only



Task-number: QTCREATORBUG-10911
Change-Id: If564db41df106334bc6909b99f37f468b5f07720
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 8a0cfc34
......@@ -100,10 +100,11 @@ void KitChooser::populate()
m_chooser->setItemData(m_chooser->count() - 1, kitToolTip(kit), Qt::ToolTipRole);
}
}
m_chooser->setEnabled(m_chooser->count() > 1);
const int n = m_chooser->count();
const int index = Core::ICore::settings()->value(QLatin1String(lastKitKey)).toInt();
m_chooser->setCurrentIndex(qMin(index, m_chooser->count()));
m_chooser->setCurrentIndex(0 <= index && index < n ? index : -1);
m_chooser->setEnabled(n > 1);
}
Kit *KitChooser::currentKit() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment