forked from qt-creator/qt-creator
Debugger: Delay restoration until Devices are restored
Change-Id: Ib3f63e84959518cd629cb98e3e348aea50979927 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
#include <QPushButton>
|
||||
#include <QTimer>
|
||||
#include <QTreeView>
|
||||
#include <QWidget>
|
||||
|
||||
@@ -62,6 +63,8 @@ public:
|
||||
DebuggerItemManagerPrivate();
|
||||
~DebuggerItemManagerPrivate();
|
||||
|
||||
void extensionsInitialized();
|
||||
|
||||
void restoreDebuggers();
|
||||
void saveDebuggers();
|
||||
|
||||
@@ -815,6 +818,10 @@ DebuggerItemManagerPrivate::DebuggerItemManagerPrivate()
|
||||
m_model = new DebuggerItemModel;
|
||||
m_optionsPage = new DebuggerOptionsPage;
|
||||
ExtensionSystem::PluginManager::addObject(m_optionsPage);
|
||||
}
|
||||
|
||||
void DebuggerItemManagerPrivate::extensionsInitialized()
|
||||
{
|
||||
restoreDebuggers();
|
||||
}
|
||||
|
||||
@@ -954,6 +961,11 @@ DebuggerItemManager::~DebuggerItemManager()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void DebuggerItemManager::extensionsInitialized()
|
||||
{
|
||||
d->extensionsInitialized();
|
||||
}
|
||||
|
||||
const QList<DebuggerItem> DebuggerItemManager::debuggers()
|
||||
{
|
||||
QList<DebuggerItem> result;
|
||||
|
||||
@@ -22,6 +22,8 @@ public:
|
||||
DebuggerItemManager();
|
||||
~DebuggerItemManager();
|
||||
|
||||
void extensionsInitialized();
|
||||
|
||||
static const QList<DebuggerItem> debuggers();
|
||||
|
||||
static QVariant registerDebugger(const DebuggerItem &item);
|
||||
|
||||
@@ -2053,6 +2053,10 @@ void DebuggerPluginPrivate::remoteCommand(const QStringList &options)
|
||||
|
||||
void DebuggerPluginPrivate::extensionsInitialized()
|
||||
{
|
||||
QTimer::singleShot(0, this, [this]{
|
||||
m_debuggerItemManager.extensionsInitialized();
|
||||
});
|
||||
|
||||
// If the CppEditor or QmlJS editor plugin is there, we want to add something to
|
||||
// the editor context menu.
|
||||
for (Id menuId : { CppEditor::Constants::M_CONTEXT, QmlJSEditor::Constants::M_CONTEXT }) {
|
||||
|
||||
@@ -2277,6 +2277,9 @@ void ProjectExplorerPlugin::extensionsInitialized()
|
||||
});
|
||||
mtools->addAction(cmd);
|
||||
|
||||
// Load devices immediately, as other plugins might want to use them
|
||||
DeviceManager::instance()->load();
|
||||
|
||||
// delay restoring kits until UI is shown for improved perceived startup performance
|
||||
QTimer::singleShot(0, this, &ProjectExplorerPlugin::restoreKits);
|
||||
}
|
||||
@@ -2285,7 +2288,6 @@ void ProjectExplorerPlugin::restoreKits()
|
||||
{
|
||||
dd->determineSessionToRestoreAtStartup();
|
||||
ExtraAbi::load(); // Load this before Toolchains!
|
||||
DeviceManager::instance()->load();
|
||||
ToolChainManager::restoreToolChains();
|
||||
KitManager::restoreKits();
|
||||
QTimer::singleShot(0, dd, &ProjectExplorerPluginPrivate::restoreSession); // delay a bit...
|
||||
|
||||
Reference in New Issue
Block a user