Commit 68dae8bc authored by dt's avatar dt
Browse files

Fix crash on creating new qt4projects

parent 9a17d441
...@@ -275,8 +275,16 @@ bool Project::restoreSettingsImpl(PersistentSettingsReader &reader) ...@@ -275,8 +275,16 @@ bool Project::restoreSettingsImpl(PersistentSettingsReader &reader)
} }
// Set Active Configuration // Set Active Configuration
QString activeConfigurationName = reader.restoreValue("activebuildconfiguration").toString(); { // Try restoring the active configuration
m_activeBuildConfiguration = buildConfigurations().at(buildConfigurationNames.indexOf(activeConfigurationName)); QString activeConfigurationName = reader.restoreValue("activebuildconfiguration").toString();
int index = buildConfigurationNames.indexOf(activeConfigurationName);
if (index != -1)
m_activeBuildConfiguration = buildConfigurations().at(index);
else if (!buildConfigurations().isEmpty())
m_activeBuildConfiguration = buildConfigurations().at(0);
else
m_activeBuildConfiguration = 0;
}
//Build Settings //Build Settings
QVariant buildStepsVariant = reader.restoreValue("buildsteps"); QVariant buildStepsVariant = reader.restoreValue("buildsteps");
......
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