Skip to content
Snippets Groups Projects
Commit ed6f2852 authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlInspector: Fix regression in live preview

ClientProxy::isEnabled() now only returns true when the server plugins
are available too. Wait until then before using it to initialize
the livepreview objects.

Reviewed-by: Lasse Holmstedt
parent ccecfd70
No related merge requests found
...@@ -118,14 +118,16 @@ void InspectorPlugin::extensionsInitialized() ...@@ -118,14 +118,16 @@ void InspectorPlugin::extensionsInitialized()
m_inspectorUi->setupUi(); 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) void InspectorPlugin::objectAdded(QObject *object)
{ {
Debugger::QmlAdapter *adapter = qobject_cast<Debugger::QmlAdapter *>(object); Debugger::QmlAdapter *adapter = qobject_cast<Debugger::QmlAdapter *>(object);
if (adapter) { if (adapter) {
m_clientProxy = new ClientProxy(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; return;
} }
...@@ -148,4 +150,9 @@ void InspectorPlugin::aboutToRemoveObject(QObject *obj) ...@@ -148,4 +150,9 @@ void InspectorPlugin::aboutToRemoveObject(QObject *obj)
} }
} }
void InspectorPlugin::clientProxyConnected()
{
m_inspectorUi->connected(m_clientProxy);
}
Q_EXPORT_PLUGIN(InspectorPlugin) Q_EXPORT_PLUGIN(InspectorPlugin)
...@@ -74,6 +74,7 @@ public: ...@@ -74,6 +74,7 @@ public:
private slots: private slots:
void objectAdded(QObject *object); void objectAdded(QObject *object);
void aboutToRemoveObject(QObject *obj); void aboutToRemoveObject(QObject *obj);
void clientProxyConnected();
private: private:
void createActions(); void createActions();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment