Fix crash with no generator selected

Change-Id: If1e09d4f6fda3b266de17087aa9b1aa0014ecaf7
Task-Nr: QTCREATORBUG-5883
Reviewed-on: http://codereview.qt.nokia.com/3410
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Daniel Teske
2011-08-23 15:36:02 +02:00
committed by Tobias Hunger
parent ebede115e8
commit 102860f2b5

View File

@@ -450,11 +450,20 @@ void CMakeRunPage::initializePage()
void CMakeRunPage::runCMake()
{
if (m_cmakeExecutable) {
// We asked the user for the cmake executable
m_cmakeWizard->cmakeManager()->setCMakeExecutable(m_cmakeExecutable->path());
}
int index = m_generatorComboBox->currentIndex();
ProjectExplorer::ToolChain *tc = 0;
if (index >= 0)
tc = static_cast<ProjectExplorer::ToolChain *>(m_generatorComboBox->itemData(index).value<void *>());
if (!tc) {
m_output->appendPlainText(tr("No generator selected."));
return;
}
m_cmakeWizard->setToolChain(tc);
@@ -475,10 +484,7 @@ void CMakeRunPage::runCMake()
Utils::Environment env = m_cmakeWizard->environment();
tc->addToEnvironment(env);
if (m_cmakeExecutable) {
// We asked the user for the cmake executable
m_cmakeWizard->cmakeManager()->setCMakeExecutable(m_cmakeExecutable->path());
}
m_output->clear();