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:
Eike Ziller
2025-02-18 13:33:32 +01:00
parent c3224d5158
commit d3c1fe6b6d
3 changed files with 11 additions and 1 deletions

View File

@@ -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");

View File

@@ -28,6 +28,8 @@ public:
static SessionManager *instance();
static bool loadsSessionOrFileAtStartup();
// higher level session management
static QString activeSession();
static QString lastSession();

View File

@@ -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: