Commit 4ebf9cb2 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Fix possible crash on project import

Fix possible crash on import of projects into creator with
only one valid Qt version set up.

Reviewed-by: dt
Task-number: QTCREATORBUG-1017
parent f9db69b8
......@@ -54,13 +54,7 @@ ProjectLoadWizard::ProjectLoadWizard(Qt4Project *project, QWidget *parent, Qt::W
setWindowTitle(tr("Project setup"));
m_importVersions = TargetSetupPage::recursivelyCheckDirectoryForBuild(project->projectDirectory());
m_importVersions.append(TargetSetupPage::recursivelyCheckDirectoryForBuild(project->defaultTopLevelBuildDirectory()));
m_importVersions.append(TargetSetupPage::importInfosForKnownQtVersions(project));
if (m_importVersions.count() > 1)
setupTargetPage();
setupTargetPage();
setOptions(options() | QWizard::NoCancelButton | QWizard::NoBackButtonOnLastPage);
}
......@@ -100,11 +94,18 @@ void ProjectLoadWizard::setupTargetPage()
if (m_targetSetupPage)
return;
QList<TargetSetupPage::ImportInfo> importVersions = TargetSetupPage::recursivelyCheckDirectoryForBuild(m_project->projectDirectory());
importVersions.append(TargetSetupPage::recursivelyCheckDirectoryForBuild(m_project->defaultTopLevelBuildDirectory()));
importVersions.append(TargetSetupPage::importInfosForKnownQtVersions(m_project));
m_targetSetupPage = new TargetSetupPage(this);
m_targetSetupPage->setImportInfos(m_importVersions);
m_targetSetupPage->setImportInfos(importVersions);
m_targetSetupPage->setImportDirectoryBrowsingEnabled(true);
m_targetSetupPage->setImportDirectoryBrowsingLocation(m_project->projectDirectory());
if (importVersions.count() <= 1)
return;
const int targetPageId = addPage(m_targetSetupPage);
wizardProgress()->item(targetPageId)->setTitle(tr("Targets"));
}
......@@ -114,4 +115,3 @@ void ProjectLoadWizard::applySettings()
Q_ASSERT(m_targetSetupPage);
m_targetSetupPage->setupProject(m_project);
}
......@@ -57,8 +57,6 @@ private:
void applySettings();
Qt4Project *m_project;
QList<TargetSetupPage::ImportInfo> m_importVersions;
TargetSetupPage *m_targetSetupPage;
};
......
Supports Markdown
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