forked from qt-creator/qt-creator
Move creating of the default session into the SessionManager ctor
There used to be 3 states for the SessionManager: 1) Uninitialized (after ctor) 2) A default virgin session 3) Using a session (including the default session) And we used to switch from state 1 to 2 or 3 after ICore::coreOpened(). This changes that we start in state 2 and thus don't emit a few signals after coreOpened. I don't think that'll break anything. Change-Id: I4cf7dade132c9d0ebd6d472d79c8b70c07acd20f Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -324,6 +324,7 @@ SessionManager::SessionManager(QObject *parent)
|
||||
: QObject(parent),
|
||||
m_file(new SessionFile),
|
||||
m_sessionNode(new SessionNode(this)),
|
||||
m_sessionName(QLatin1String("default")),
|
||||
m_virginSession(true)
|
||||
{
|
||||
connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
|
||||
@@ -340,6 +341,7 @@ SessionManager::SessionManager(QObject *parent)
|
||||
connect(em, SIGNAL(editorsClosed(QList<Core::IEditor*>)),
|
||||
this, SLOT(markSessionFileDirty()));
|
||||
|
||||
m_file->setFileName(sessionNameToFileName(m_sessionName));
|
||||
|
||||
m_autoSaveSessionTimer = new QTimer(this);
|
||||
m_autoSaveSessionTimer->setSingleShot(true);
|
||||
@@ -980,15 +982,6 @@ QString SessionManager::sessionNameFromFileName(const QString &fileName) const
|
||||
return fileName.mid(slash + 1, fileName.length() - slash - 5); // Exclude .qws
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Creates a new default session and switches to it.
|
||||
*/
|
||||
|
||||
void SessionManager::createAndLoadNewDefaultSession()
|
||||
{
|
||||
createImpl(sessionNameToFileName(QLatin1String("default")));
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Just creates a new session (Does not actually create the file).
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user