Commit d51edeaf authored by Daniel Teske's avatar Daniel Teske

Fix "Projects mode" looking broken if the startup project is "wrong"

E.g. this could happen if a session with two projects is opened, where
the startup project no longer exists.

Change-Id: I1c60bacb62b5f39f7830a3bc30e3aa388a825884
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 5692c681
......@@ -748,15 +748,17 @@ void SessionManager::restoreStartupProject(const Utils::PersistentSettingsReader
{
const QString startupProject = reader.restoreValue(QLatin1String("StartupProject")).toString();
if (!startupProject.isEmpty()) {
const QString startupProjectPath = startupProject;
foreach (Project *pro, m_projects) {
if (QDir::cleanPath(pro->document()->fileName()) == startupProjectPath) {
if (QDir::cleanPath(pro->document()->fileName()) == startupProject) {
setStartupProject(pro);
break;
}
}
if (!m_startupProject)
qWarning() << "Could not find startup project" << startupProjectPath;
}
if (!m_startupProject) {
qWarning() << "Could not find startup project" << startupProject;
if (!projects().isEmpty())
setStartupProject(projects().first());
}
}
......
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