Session: Fix saving session data on shutdown from project mode

This was broken in d52ee686d1.

Task-number: QTCREATORBUG-13098
Change-Id: Ia075e13fdd00e561b78058a3cab0cb02d2eb5fe6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Daniel Teske
2014-09-26 12:45:42 +02:00
parent bf5f14a4e1
commit fe8ed7f5a6
3 changed files with 6 additions and 5 deletions

View File

@@ -320,7 +320,7 @@ bool ModeManager::isModeSelectorVisible()
return d->m_modeSelectorVisible;
}
QObject *ModeManager::instance()
ModeManager *ModeManager::instance()
{
return m_instance;
}

View File

@@ -52,7 +52,7 @@ class CORE_EXPORT ModeManager : public QObject
Q_OBJECT
public:
static QObject *instance();
static ModeManager *instance();
static IMode *currentMode();
static IMode *mode(Id id);

View File

@@ -1277,6 +1277,8 @@ void ProjectExplorerPlugin::updateRunWithoutDeployMenu()
ExtensionSystem::IPlugin::ShutdownFlag ProjectExplorerPlugin::aboutToShutdown()
{
disconnect(ModeManager::instance(), &ModeManager::currentModeChanged,
this, &ProjectExplorerPlugin::currentModeChanged);
d->m_proWindow->aboutToShutdown(); // disconnect from session
SessionManager::closeAllProjects();
d->m_projectsMode = 0;
@@ -1673,9 +1675,8 @@ void ProjectExplorerPlugin::restoreSession()
SessionManager::loadSession(d->m_sessionToRestoreAtStartup);
// update welcome page
connect(ModeManager::instance(),
SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)),
SLOT(currentModeChanged(Core::IMode*,Core::IMode*)));
connect(ModeManager::instance(), &ModeManager::currentModeChanged,
this, &ProjectExplorerPlugin::currentModeChanged);
#if HAS_WELCOME_PAGE
connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString)));
connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(openProjectWelcomePage(QString)));