diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 55815c5d82f..4e103cc528f 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1257,10 +1257,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er connect(buildManager, &BuildManager::buildQueueFinished, dd, &ProjectExplorerPluginPrivate::buildQueueFinished, Qt::QueuedConnection); - connect(ICore::instance(), &ICore::coreAboutToOpen, - dd, &ProjectExplorerPluginPrivate::determineSessionToRestoreAtStartup); - connect(ICore::instance(), &ICore::coreOpened, - dd, &ProjectExplorerPluginPrivate::restoreSession); connect(ICore::instance(), &ICore::newItemDialogRunningChanged, updateActions); connect(ICore::instance(), &ICore::newItemDialogRunningChanged, dd, &ProjectExplorerPluginPrivate::updateContextMenuActions); @@ -1506,9 +1502,16 @@ void ProjectExplorerPlugin::extensionsInitialized() BuildManager::extensionsInitialized(); DeviceManager::instance()->addDevice(IDevice::Ptr(new DesktopDevice)); +} + +bool ProjectExplorerPlugin::delayedInitialize() +{ + dd->determineSessionToRestoreAtStartup(); DeviceManager::instance()->load(); ToolChainManager::restoreToolChains(); dd->m_kitManager->restoreKits(); + QTimer::singleShot(0, dd, &ProjectExplorerPluginPrivate::restoreSession); // delay a bit... + return true; } void ProjectExplorerPluginPrivate::updateRunWithoutDeployMenu() diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index ac3e04e3cab..1ca80bfacfa 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -120,6 +120,7 @@ public: //PluginInterface bool initialize(const QStringList &arguments, QString *errorMessage) override; void extensionsInitialized() override; + bool delayedInitialize() override; ShutdownFlag aboutToShutdown() override; static void setProjectExplorerSettings(const Internal::ProjectExplorerSettings &pes);