ModeManager: Don't switch to weclome mode for session restore

This commit is contained in:
dt
2010-09-06 16:48:49 +02:00
parent 33c3e1cb89
commit 6863b02e03

View File

@@ -83,7 +83,8 @@ ModeManagerPrivate::ModeManagerPrivate(Internal::MainWindow *mainWindow,
m_mainWindow(mainWindow),
m_modeStack(modeStack),
m_signalMapper(new QSignalMapper(q)),
m_oldCurrent(-1)
m_oldCurrent(-1),
m_switchedToMode(false)
{
}
@@ -151,6 +152,7 @@ IMode *ModeManager::mode(const QString &id) const
void ModeManager::activateMode(const QString &id)
{
m_switchedToMode = true;
const int index = indexOf(id);
if (index >= 0)
d->m_modeStack->setCurrentIndex(index);
@@ -311,7 +313,8 @@ void ModeManager::setFocusToCurrentMode()
void ModeManager::switchToDefaultMode()
{
d->m_modeStack->setCurrentIndex(0);
if (!m_switchedToMode)
d->m_modeStack->setCurrentIndex(0);
}
ModeManager *ModeManager::instance()