summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-08-16 11:33:16 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-08-16 11:45:50 (GMT)
commitf7a501515fcf1dafecb88a40e18721ea14fd0a13 (patch)
tree8f36b6de76f9dc3d650fbd4c6a58b30773459328 /src
parent7e395e4f5a89dd43d1b7b88f12e0fa4107756d54 (diff)
downloadQt-f7a501515fcf1dafecb88a40e18721ea14fd0a13.zip
Qt-f7a501515fcf1dafecb88a40e18721ea14fd0a13.tar.gz
Qt-f7a501515fcf1dafecb88a40e18721ea14fd0a13.tar.bz2
QtDeclarative debugging: Add an option not to stream the properties of an object.
Streaming all the properties is too slow, and we do not need them in the debugger of creator. Reviewed-by: Lasse Holmstedt
Diffstat (limited to 'src')
-rw-r--r--src/declarative/debugger/qdeclarativedebug.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp16
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug_p.h2
3 files changed, 15 insertions, 7 deletions
diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp
index b950aef..154df51 100644
--- a/src/declarative/debugger/qdeclarativedebug.cpp
+++ b/src/declarative/debugger/qdeclarativedebug.cpp
@@ -507,7 +507,7 @@ QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObject(const QDeclar
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
- << false;
+ << false << true;
d->client->sendMessage(message);
} else {
query->m_state = QDeclarativeDebugQuery::Error;
@@ -530,7 +530,7 @@ QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObjectRecursive(cons
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
- << true;
+ << true << true;
d->client->sendMessage(message);
} else {
query->m_state = QDeclarativeDebugQuery::Error;
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 1837366..ed98e3c 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -182,7 +182,7 @@ QVariant QDeclarativeEngineDebugServer::valueContents(const QVariant &value) con
}
void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
- QObject *object, bool recur)
+ QObject *object, bool recur, bool dumpProperties)
{
message << objectData(object);
@@ -209,6 +209,8 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
continue;
QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child);
if (signal) {
+ if (!dumpProperties)
+ continue;
QDeclarativeObjectProperty prop;
prop.type = QDeclarativeObjectProperty::SignalProperty;
prop.hasNotifySignal = false;
@@ -229,12 +231,17 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
fakeProperties << prop;
} else {
if (recur)
- buildObjectDump(message, child, recur);
+ buildObjectDump(message, child, recur, dumpProperties);
else
message << objectData(child);
}
}
+ if (!dumpProperties) {
+ message << 0;
+ return;
+ }
+
message << (object->metaObject()->propertyCount() + fakeProperties.count());
for (int ii = 0; ii < object->metaObject()->propertyCount(); ++ii)
@@ -372,8 +379,9 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
int queryId;
int objectId;
bool recurse;
+ bool dumpProperties = true;
- ds >> queryId >> objectId >> recurse;
+ ds >> queryId >> objectId >> recurse >> dumpProperties;
QObject *object = QDeclarativeDebugService::objectForId(objectId);
@@ -382,7 +390,7 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
rs << QByteArray("FETCH_OBJECT_R") << queryId;
if (object)
- buildObjectDump(rs, object, recurse);
+ 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 ea35b40..aa450f3 100644
--- a/src/declarative/qml/qdeclarativeenginedebug_p.h
+++ b/src/declarative/qml/qdeclarativeenginedebug_p.h
@@ -103,7 +103,7 @@ private Q_SLOTS:
private:
void buildObjectList(QDataStream &, QDeclarativeContext *);
- void buildObjectDump(QDataStream &, QObject *, bool);
+ void buildObjectDump(QDataStream &, QObject *, bool, bool);
QDeclarativeObjectData objectData(QObject *);
QDeclarativeObjectProperty propertyData(QObject *, int);
QVariant valueContents(const QVariant &defaultValue) const;