Commit 94cb5db5 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Fix possible crash in TargetSetupPage

Properly register Qt versions and do not delete them afterwards

Task-number: QTCREATORBUG-1122
Reviewed-by: dt
parent 66e5da21
...@@ -203,6 +203,7 @@ bool TargetSetupPage::isTargetSelected(const QString &targetid) const ...@@ -203,6 +203,7 @@ bool TargetSetupPage::isTargetSelected(const QString &targetid) const
bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project) bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project)
{ {
Q_ASSERT(project->targets().isEmpty()); Q_ASSERT(project->targets().isEmpty());
QtVersionManager *vm = QtVersionManager::instance();
for (int i = 0; i < m_treeWidget->topLevelItemCount(); ++i) { for (int i = 0; i < m_treeWidget->topLevelItemCount(); ++i) {
QTreeWidgetItem *current = m_treeWidget->topLevelItem(i); QTreeWidgetItem *current = m_treeWidget->topLevelItem(i);
...@@ -214,7 +215,13 @@ bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project) ...@@ -214,7 +215,13 @@ bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project)
if (child->checkState(0) != Qt::Checked) if (child->checkState(0) != Qt::Checked)
continue; continue;
const ImportInfo &info = m_infos.at(child->data(0, Qt::UserRole).toInt()); ImportInfo &info = m_infos[child->data(0, Qt::UserRole).toInt()];
// Register temporary Qt version
if (info.isTemporary) {
vm->addVersion(info.version);
info.isTemporary = false;
}
if ((info.buildConfig | QtVersion::DebugBuild) != info.buildConfig) if ((info.buildConfig | QtVersion::DebugBuild) != info.buildConfig)
targetInfos.append(BuildConfigurationInfo(info.version, QtVersion::QmakeBuildConfigs(info.buildConfig | QtVersion::DebugBuild), targetInfos.append(BuildConfigurationInfo(info.version, QtVersion::QmakeBuildConfigs(info.buildConfig | QtVersion::DebugBuild),
...@@ -322,7 +329,7 @@ TargetSetupPage::recursivelyCheckDirectoryForBuild(const QString &directory, int ...@@ -322,7 +329,7 @@ TargetSetupPage::recursivelyCheckDirectoryForBuild(const QString &directory, int
return results; return results;
// Check for in-source builds first: // Check for in-source builds first:
QString qmakeBinary = QtVersionManager::findQMakeBinaryFromMakefile(directory); QString qmakeBinary = QtVersionManager::findQMakeBinaryFromMakefile(directory);
// Recurse into subdirectories: // Recurse into subdirectories:
if (qmakeBinary.isNull()) { if (qmakeBinary.isNull()) {
......
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