forked from qt-creator/qt-creator
Delay kit initialization until after the UI is up
This can potentially be expensive, so delay it. Side effect is that the "History:" label in the Search Result OutputPane is now correctly rendered:-) That was broken since the Kit initialization triggered an event loop to be run too early by running a SynchronousProcess. Change-Id: I905c33c6facbbe03f22b9860c277ec658af9326e Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -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()
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user