forked from qt-creator/qt-creator
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
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
private slots:
|
||||
void objectAdded(QObject *object);
|
||||
void aboutToRemoveObject(QObject *obj);
|
||||
void clientProxyConnected();
|
||||
|
||||
private:
|
||||
void createActions();
|
||||
|
||||
Reference in New Issue
Block a user