forked from qt-creator/qt-creator
Skip Welcome mode when loading session or file at startup
Fixes: QTCREATORBUG-32321 Change-Id: I469437ab4b5dea917cdaff2341264f5eebf675e8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -409,6 +409,12 @@ static QString determineSessionToRestoreAtStartup()
|
||||
return {};
|
||||
}
|
||||
|
||||
bool SessionManager::loadsSessionOrFileAtStartup()
|
||||
{
|
||||
// "left-over arguments" usually mean a session or files
|
||||
return !PluginManager::arguments().isEmpty() || !determineSessionToRestoreAtStartup().isEmpty();
|
||||
}
|
||||
|
||||
void SessionManagerPrivate::restoreStartupSession()
|
||||
{
|
||||
NANOTRACE_SCOPE("Core", "SessionManagerPrivate::restoreStartupSession");
|
||||
|
@@ -28,6 +28,8 @@ public:
|
||||
|
||||
static SessionManager *instance();
|
||||
|
||||
static bool loadsSessionOrFileAtStartup();
|
||||
|
||||
// higher level session management
|
||||
static QString activeSession();
|
||||
static QString lastSession();
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include <coreplugin/imode.h>
|
||||
#include <coreplugin/iwelcomepage.h>
|
||||
#include <coreplugin/modemanager.h>
|
||||
#include <coreplugin/session.h>
|
||||
#include <coreplugin/welcomepagehelper.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
@@ -360,7 +361,8 @@ public:
|
||||
void extensionsInitialized()
|
||||
{
|
||||
m_modeWidget->initPlugins();
|
||||
ModeManager::activateMode(id());
|
||||
if (!SessionManager::loadsSessionOrFileAtStartup())
|
||||
ModeManager::activateMode(id());
|
||||
}
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user