summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@nokia.com>2010-12-10 10:47:43 (GMT)
committerChristiaan Janssen <christiaan.janssen@nokia.com>2010-12-10 10:47:43 (GMT)
commit6541562252cecd102788257022d3cf159954cae8 (patch)
treeed7c7fdcebfafbcb8c897e58ec302c860b342ef0
parent5710cc981ae39a018d4c30b2c77f6623713a5bf1 (diff)
downloadQt-6541562252cecd102788257022d3cf159954cae8.zip
Qt-6541562252cecd102788257022d3cf159954cae8.tar.gz
Qt-6541562252cecd102788257022d3cf159954cae8.tar.bz2
QmlDebugger: Instantiation of deferred objects moved to the debugger engine
Reviewed-by: Kai Koehne
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp6
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp22
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug_p.h1
3 files changed, 18 insertions, 11 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index b375b27..4749bf8 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -65,7 +65,6 @@
#include "private/qdeclarativebinding_p.h"
#include "private/qdeclarativecompiledbindings_p.h"
#include "private/qdeclarativeglobalscriptclass_p.h"
-#include "private/qdeclarativedebugservice_p.h"
#include <QColor>
#include <QDebug>
@@ -755,10 +754,7 @@ bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt)
QList<QDeclarativeCustomParserProperty> customProps;
// Fetch the list of deferred properties
- QStringList deferredList;
- if (!QDeclarativeDebugService::isDebuggingEnabled()) {
- deferredList = deferredProperties(obj);
- }
+ QStringList deferredList = deferredProperties(obj);
// Must do id property first. This is to ensure that the id given to any
// id reference created matches the order in which the objects are
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index bffe681..5f338db 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -192,11 +192,6 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
{
message << objectData(object);
- // Some children aren't added to an object until particular properties are read
- // - e.g. child state objects aren't added until the 'states' property is read -
- // but this should only affect internal objects that aren't shown by the
- // debugger anyway.
-
QObjectList children = object->children();
int childrenCount = children.count();
@@ -257,6 +252,18 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
message << fakeProperties[ii];
}
+void QDeclarativeEngineDebugServer::prepareDeferredObjects(QObject *obj)
+{
+ qmlExecuteDeferred(obj);
+
+ QObjectList children = obj->children();
+ for (int ii = 0; ii < children.count(); ++ii) {
+ QObject *child = children.at(ii);
+ prepareDeferredObjects(child);
+ }
+
+}
+
void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message, QDeclarativeContext *ctxt)
{
QDeclarativeContextData *p = QDeclarativeContextData::get(ctxt);
@@ -393,8 +400,11 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
QDataStream rs(&reply, QIODevice::WriteOnly);
rs << QByteArray("FETCH_OBJECT_R") << queryId;
- if (object)
+ if (object) {
+ if (recurse)
+ prepareDeferredObjects(object);
buildObjectDump(rs, object, recurse, dumpProperties);
+ }
sendMessage(reply);
} else if (type == "WATCH_OBJECT") {
diff --git a/src/declarative/qml/qdeclarativeenginedebug_p.h b/src/declarative/qml/qdeclarativeenginedebug_p.h
index 97b8121..dc8bc85 100644
--- a/src/declarative/qml/qdeclarativeenginedebug_p.h
+++ b/src/declarative/qml/qdeclarativeenginedebug_p.h
@@ -105,6 +105,7 @@ private Q_SLOTS:
void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value);
private:
+ void prepareDeferredObjects(QObject *);
void buildObjectList(QDataStream &, QDeclarativeContext *);
void buildObjectDump(QDataStream &, QObject *, bool, bool);
QDeclarativeObjectData objectData(QObject *);