Merge remote-tracking branch 'origin/2.5'

Conflicts:
	tests/system/objects.map

Change-Id: Ie6aed14f2f61111d26498ff3684ea4a57e6da59e
This commit is contained in:
Eike Ziller
2012-06-01 14:06:24 +02:00
16 changed files with 130 additions and 36 deletions

View File

@@ -93,6 +93,7 @@ SessionManager::SessionManager(QObject *parent)
m_sessionNode(new SessionNode(this)),
m_sessionName(QLatin1String("default")),
m_virginSession(true),
m_loadingSession(false),
m_startupProject(0)
{
connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
@@ -294,6 +295,11 @@ void SessionManager::removeProject(Project *project)
removeProjects(QList<Project*>() << project);
}
bool SessionManager::loadingSession()
{
return m_loadingSession;
}
bool SessionManager::save()
{
if (debug)
@@ -818,17 +824,23 @@ bool SessionManager::loadSession(const QString &session)
}
}
m_loadingSession = true;
// Allow everyone to set something in the session and before saving
emit aboutToUnloadSession(m_sessionName);
if (!isDefaultVirgin()) {
if (!save())
if (!save()) {
m_loadingSession = false;
return false;
}
}
// Clean up
if (!ICore::editorManager()->closeAllEditors())
if (!ICore::editorManager()->closeAllEditors()) {
m_loadingSession = false;
return false;
}
setStartupProject(0);
removeProjects(projects());
@@ -883,6 +895,7 @@ bool SessionManager::loadSession(const QString &session)
// Starts a event loop, better do that at the very end
askUserAboutFailedProjects();
m_loadingSession = false;
return true;
}