diff --git a/src/plugins/qmljsinspector/qmljsinspectorplugin.cpp b/src/plugins/qmljsinspector/qmljsinspectorplugin.cpp index a972d1ba50587201e7824afe18754faf0adc65d6..a89f00d0baaeec606350b633fd4eb95173ff2a1f 100644 --- a/src/plugins/qmljsinspector/qmljsinspectorplugin.cpp +++ b/src/plugins/qmljsinspector/qmljsinspectorplugin.cpp @@ -118,14 +118,16 @@ void InspectorPlugin::extensionsInitialized() m_inspectorUi->setupUi(); } -// The adapter object is only added to the pool with a succesful connection, -// so we can immediately init our stuff. void InspectorPlugin::objectAdded(QObject *object) { Debugger::QmlAdapter *adapter = qobject_cast<Debugger::QmlAdapter *>(object); if (adapter) { m_clientProxy = new ClientProxy(adapter); - m_inspectorUi->connected(m_clientProxy); + if (m_clientProxy->isConnected()) { + clientProxyConnected(); + } else { + connect(m_clientProxy, SIGNAL(connected()), this, SLOT(clientProxyConnected())); + } return; } @@ -148,4 +150,9 @@ void InspectorPlugin::aboutToRemoveObject(QObject *obj) } } +void InspectorPlugin::clientProxyConnected() +{ + m_inspectorUi->connected(m_clientProxy); +} + Q_EXPORT_PLUGIN(InspectorPlugin) diff --git a/src/plugins/qmljsinspector/qmljsinspectorplugin.h b/src/plugins/qmljsinspector/qmljsinspectorplugin.h index ea4a378c74e701231e940e64b4b3dcd6799a1e36..f0f9500fb744a912c8d6bb16c11efd9d94714959 100644 --- a/src/plugins/qmljsinspector/qmljsinspectorplugin.h +++ b/src/plugins/qmljsinspector/qmljsinspectorplugin.h @@ -74,6 +74,7 @@ public: private slots: void objectAdded(QObject *object); void aboutToRemoveObject(QObject *obj); + void clientProxyConnected(); private: void createActions();