summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/qml/qmlinspectoragent.cpp
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@digia.com>2012-09-28 14:40:57 +0200
committerAurindam Jana <aurindam.jana@digia.com>2012-10-01 12:49:59 +0200
commitbb00f59d66a87a63987f93f83db9d36b18be433b (patch)
treee7f7fd5110b7842055c0fc59b55a6d14bde9b0aa /src/plugins/debugger/qml/qmlinspectoragent.cpp
parentceb9319e4bbbc849ebed8f6103bc8710ff7e4b79 (diff)
downloadqt-creator-bb00f59d66a87a63987f93f83db9d36b18be433b.tar.gz
Debugger: Client for DeclarativeDebugger
A client for DeclarativeDebugger Service. The service is a backport of QmlDebugger service. Change-Id: I868a286756c2d6bcbb2f41904a13d7f691e9704c Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
Diffstat (limited to 'src/plugins/debugger/qml/qmlinspectoragent.cpp')
-rw-r--r--src/plugins/debugger/qml/qmlinspectoragent.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp
index 589be454c2..21734dbd9a 100644
--- a/src/plugins/debugger/qml/qmlinspectoragent.cpp
+++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp
@@ -42,6 +42,7 @@
#include <QElapsedTimer>
using namespace QmlDebug;
+using namespace QmlDebug::Constants;
namespace Debugger {
namespace Internal {
@@ -476,7 +477,7 @@ void QmlInspectorAgent::newObject(int engineId, int objectId, int /*parentId*/)
return;
m_newObjectsCreated = true;
- if (m_engineClient->objectName() == QLatin1String(QmlDebug::Constants::QML_DEBUGGER))
+ if (m_engineClient->objectName() != QLatin1String(QDECLARATIVE_ENGINE))
fetchObject(objectId);
else
m_delayQueryTimer.start();
@@ -595,13 +596,13 @@ void QmlInspectorAgent::fetchObjectsInContextRecursive(const ContextReference &c
foreach (const ObjectReference & obj, context.objects()) {
using namespace QmlDebug::Constants;
- if (m_engineClient->objectName() == QLatin1String(QML_DEBUGGER) &&
- m_engineClient->serviceVersion() >= CURRENT_SUPPORTED_VERSION) {
- //Fetch only root objects
+ // qt <= 4.8.3
+ if (m_engineClient->objectName() == QLatin1String(QDECLARATIVE_ENGINE)) {
+ m_objectTreeQueryIds << m_engineClient->queryObjectRecursive(obj.debugId());
+ } else {
+ // Fetch only root objects for qt > 4.8.3
if (obj.parentId() == -1)
fetchObject(obj.debugId());
- } else {
- m_objectTreeQueryIds << m_engineClient->queryObjectRecursive(obj.debugId());
}
}
foreach (const ContextReference &child, context.contexts())
@@ -628,8 +629,8 @@ void QmlInspectorAgent::objectTreeFetched(const ObjectReference &object)
ObjectReference last;
QStack<QmlDebug::ObjectReference> stack;
- // 4.x
- if (m_newObjectsCreated && m_engineClient->objectName() != QLatin1String(QmlDebug::Constants::QML_DEBUGGER)) {
+ // qt <= 4.8.3
+ if (m_newObjectsCreated && m_engineClient->objectName() == QLatin1String(QDECLARATIVE_ENGINE)) {
// We need to reverse the stack as the root objects
// are pushed to the bottom since they are fetched first.
// The child objects need to placed in the correct position and therefore
@@ -645,8 +646,8 @@ void QmlInspectorAgent::objectTreeFetched(const ObjectReference &object)
int parentId = last.parentId();
QByteArray parentIname;
- // 4.x
- if (m_engineClient->objectName() != QLatin1String(QmlDebug::Constants::QML_DEBUGGER)) {
+ // qt <= 4.8.3
+ if (m_engineClient->objectName() == QLatin1String(QDECLARATIVE_ENGINE)) {
QHashIterator<int, QList<int> > i(m_debugIdChildIds);
while (i.hasNext()) {
i.next();
@@ -662,8 +663,8 @@ void QmlInspectorAgent::objectTreeFetched(const ObjectReference &object)
fetchObject(parentId);
return;
}
- // 5.x
- if (m_engineClient->objectName() == QLatin1String(QmlDebug::Constants::QML_DEBUGGER)
+ // qt > 4.8.3
+ if (m_engineClient->objectName() != QLatin1String(QDECLARATIVE_ENGINE)
&& m_newObjectsCreated && parentIname.isEmpty()) {
if (watchData.count())
break;
@@ -735,13 +736,13 @@ void QmlInspectorAgent::buildDebugIdHashRecursive(const ObjectReference &ref)
m_debugIdHash[file][location].append(ref.debugId());
m_debugIdLocations.insert(ref.debugId(), FileReference(filePath, lineNum, colNum));
- // 4.x
- if (m_newObjectsCreated && m_engineClient->objectName() != QLatin1String(QmlDebug::Constants::QML_DEBUGGER)) {
+ // qt <= 4.8.3
+ if (m_newObjectsCreated && m_engineClient->objectName() == QLatin1String(QDECLARATIVE_ENGINE)) {
QList<int> childIds;
foreach (const ObjectReference &c, ref.children()) {
childIds << c.debugId();
}
- // For 4.x, we do not get the parentId. Hence, store the child ids
+ // For qt <= 4.8.3, we do not get the parentId. Hence, store the child ids
// to look up correct insertion places later
m_debugIdChildIds.insert(ref.debugId(), childIds);
}
@@ -877,8 +878,8 @@ void QmlInspectorAgent::clearObjectTree()
m_debugIdToIname.clear();
m_debugIdChildIds.clear();
m_objectStack.clear();
- // reset only for 5.x.
- if (m_engineClient->objectName() == QLatin1String(QmlDebug::Constants::QML_DEBUGGER))
+ // reset only for qt > 4.8.3.
+ if (m_engineClient->objectName() != QLatin1String(QDECLARATIVE_ENGINE))
m_newObjectsCreated = false;
removeAllObjectWatches();