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