QmlJSInspector: New Objects created

Send the engineid, objectid and parentid.

Change-Id: I7b340c1f20ba3eb3f1690d45b28819f6efaae013
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Aurindam Jana
2012-05-14 16:11:12 +02:00
parent fd5b22062c
commit b9d9bb7ba8
6 changed files with 32 additions and 8 deletions

View File

@@ -188,7 +188,10 @@ void BaseEngineDebugClient::messageReceived(const QByteArray &data)
ds >> type;
if (type == "OBJECT_CREATED") {
emit newObjects();
int engineId;
int objectId;
ds >> engineId >> objectId;
emit newObject(engineId, objectId, -1);
return;
}

View File

@@ -81,7 +81,7 @@ public:
signals:
void newStatus(QmlDebug::ClientStatus status);
void newObjects();
void newObject(int engineId, int objectId, int parentId);
void valueChanged(int debugId, const QByteArray &name,
const QVariant &value);
void result(quint32 queryId, const QVariant &result, const QByteArray &type);

View File

@@ -90,4 +90,22 @@ quint32 QmlEngineDebugClient::setMethodBody(
return id;
}
void QmlEngineDebugClient::messageReceived(const QByteArray &data)
{
QDataStream ds(data);
int queryId;
QByteArray type;
ds >> type >> queryId;
if (type == "OBJECT_CREATED") {
int engineId;
int objectId;
int parentId;
ds >> engineId >> objectId >> parentId;
emit newObject(engineId, objectId, parentId);
return;
} else {
BaseEngineDebugClient::messageReceived(data);
}
}
} // namespace QmlDebug

View File

@@ -51,6 +51,9 @@ public:
quint32 resetBindingForObject(int objectDebugId, const QString &propertyName);
quint32 setMethodBody(int objectDebugId, const QString &methodName,
const QString &methodBody);
protected:
void messageReceived(const QByteArray &data);
};
} // namespace QmlDebug

View File

@@ -345,8 +345,8 @@ void QmlInspectorAgent::setEngineClient(BaseEngineDebugClient *client)
this, SLOT(updateStatus()));
disconnect(m_engineClient, SIGNAL(result(quint32,QVariant,QByteArray)),
this, SLOT(onResult(quint32,QVariant,QByteArray)));
disconnect(m_engineClient, SIGNAL(newObjects()),
this, SLOT(newObjects()));
disconnect(m_engineClient, SIGNAL(newObject(int,int,int)),
this, SLOT(newObject(int,int,int)));
}
m_engineClient = client;
@@ -356,8 +356,8 @@ void QmlInspectorAgent::setEngineClient(BaseEngineDebugClient *client)
this, SLOT(updateStatus()));
connect(m_engineClient, SIGNAL(result(quint32,QVariant,QByteArray)),
this, SLOT(onResult(quint32,QVariant,QByteArray)));
connect(m_engineClient, SIGNAL(newObjects()),
this, SLOT(newObjects()));
connect(m_engineClient, SIGNAL(newObject(int,int,int)),
this, SLOT(newObject(int,int,int)));
}
updateStatus();
@@ -425,7 +425,7 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
}
void QmlInspectorAgent::newObjects()
void QmlInspectorAgent::newObject(int /*engineId*/, int /*objectId*/, int /*parentId*/)
{
if (debug)
qDebug() << __FUNCTION__ << "()";

View File

@@ -102,7 +102,7 @@ signals:
private slots:
void updateStatus();
void onResult(quint32 queryId, const QVariant &value, const QByteArray &type);
void newObjects();
void newObject(int engineId, int objectId, int parentId);
private:
void reloadEngines();