diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 2262a5289b5..b45059720e8 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1468,11 +1468,8 @@ void ProjectExplorerPlugin::restoreSession() arguments.removeOne(d->m_sessionToRestoreAtStartup); // Restore latest session or what was passed on the command line - if (d->m_sessionToRestoreAtStartup.isEmpty()) { - d->m_session->createAndLoadNewDefaultSession(); - } else { + if (!d->m_sessionToRestoreAtStartup.isEmpty()) d->m_session->loadSession(d->m_sessionToRestoreAtStartup); - } // update welcome page connect(Core::ModeManager::instance(), diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 0999425d679..8e5b21cfdf7 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -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)), 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). */ diff --git a/src/plugins/projectexplorer/session.h b/src/plugins/projectexplorer/session.h index dd93601cb6e..d7a3304dae8 100644 --- a/src/plugins/projectexplorer/session.h +++ b/src/plugins/projectexplorer/session.h @@ -76,7 +76,6 @@ public: QString lastSession() const; QStringList sessions() const; - void createAndLoadNewDefaultSession(); bool createSession(const QString &session); bool deleteSession(const QString &session);