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 {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SessionManager::loadsSessionOrFileAtStartup()
|
||||||
|
{
|
||||||
|
// "left-over arguments" usually mean a session or files
|
||||||
|
return !PluginManager::arguments().isEmpty() || !determineSessionToRestoreAtStartup().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
void SessionManagerPrivate::restoreStartupSession()
|
void SessionManagerPrivate::restoreStartupSession()
|
||||||
{
|
{
|
||||||
NANOTRACE_SCOPE("Core", "SessionManagerPrivate::restoreStartupSession");
|
NANOTRACE_SCOPE("Core", "SessionManagerPrivate::restoreStartupSession");
|
||||||
|
@@ -28,6 +28,8 @@ public:
|
|||||||
|
|
||||||
static SessionManager *instance();
|
static SessionManager *instance();
|
||||||
|
|
||||||
|
static bool loadsSessionOrFileAtStartup();
|
||||||
|
|
||||||
// higher level session management
|
// higher level session management
|
||||||
static QString activeSession();
|
static QString activeSession();
|
||||||
static QString lastSession();
|
static QString lastSession();
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
#include <coreplugin/imode.h>
|
#include <coreplugin/imode.h>
|
||||||
#include <coreplugin/iwelcomepage.h>
|
#include <coreplugin/iwelcomepage.h>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
|
#include <coreplugin/session.h>
|
||||||
#include <coreplugin/welcomepagehelper.h>
|
#include <coreplugin/welcomepagehelper.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
@@ -360,6 +361,7 @@ public:
|
|||||||
void extensionsInitialized()
|
void extensionsInitialized()
|
||||||
{
|
{
|
||||||
m_modeWidget->initPlugins();
|
m_modeWidget->initPlugins();
|
||||||
|
if (!SessionManager::loadsSessionOrFileAtStartup())
|
||||||
ModeManager::activateMode(id());
|
ModeManager::activateMode(id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user