forked from qt-creator/qt-creator
CMake: Make the default kit as the current generator
Change-Id: Id8b42469fc7fdc22278bcaf4f5cb60f42d8f6c53 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -663,6 +663,7 @@ void CMakeRunPage::initializePage()
|
|||||||
m_generatorComboBox->show();
|
m_generatorComboBox->show();
|
||||||
QList<ProjectExplorer::Kit *> kitList =
|
QList<ProjectExplorer::Kit *> kitList =
|
||||||
ProjectExplorer::KitManager::instance()->kits();
|
ProjectExplorer::KitManager::instance()->kits();
|
||||||
|
int defaultIndex = 0;
|
||||||
|
|
||||||
foreach (ProjectExplorer::Kit *k, kitList) {
|
foreach (ProjectExplorer::Kit *k, kitList) {
|
||||||
QList<GeneratorInfo> infos = GeneratorInfo::generatorInfosFor(k,
|
QList<GeneratorInfo> infos = GeneratorInfo::generatorInfosFor(k,
|
||||||
@@ -670,10 +671,15 @@ void CMakeRunPage::initializePage()
|
|||||||
preferNinja,
|
preferNinja,
|
||||||
hasCodeBlocksGenerator);
|
hasCodeBlocksGenerator);
|
||||||
|
|
||||||
|
if (k == ProjectExplorer::KitManager::instance()->defaultKit())
|
||||||
|
defaultIndex = m_generatorComboBox->count();
|
||||||
|
|
||||||
foreach (const GeneratorInfo &info, infos)
|
foreach (const GeneratorInfo &info, infos)
|
||||||
if (cachedGenerator.isEmpty() || info.generator() == cachedGenerator)
|
if (cachedGenerator.isEmpty() || info.generator() == cachedGenerator)
|
||||||
m_generatorComboBox->addItem(info.displayName(), qVariantFromValue(info));
|
m_generatorComboBox->addItem(info.displayName(), qVariantFromValue(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_generatorComboBox->setCurrentIndex(defaultIndex);
|
||||||
} else {
|
} else {
|
||||||
// Note: We don't compare the actually cached generator to what is set in the buildconfiguration
|
// Note: We don't compare the actually cached generator to what is set in the buildconfiguration
|
||||||
// We assume that the buildconfiguration is correct
|
// We assume that the buildconfiguration is correct
|
||||||
|
|||||||
Reference in New Issue
Block a user