aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling
diff options
context:
space:
mode:
authorSimjees Abraham <simjees.abraham@nokia.com>2012-05-25 09:18:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-29 12:18:39 +0200
commit2a3fc36b080e135e630b67a070ec540e94b331b7 (patch)
treee592992344c89c8d294a82d1f2e29607fc71fd28 /src/plugins/qmltooling
parent4baa3f7105004ce815b5b16b05d895814263e987 (diff)
Debugger: Modified response for "destroyObject" message.
The response for "destroyObject" carries the debugId of the destroyed object. Change-Id: I9be56f8db42ff2e83544ebbd058a6a8d48b4c98f Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Diffstat (limited to 'src/plugins/qmltooling')
-rw-r--r--src/plugins/qmltooling/shared/abstractviewinspector.cpp11
-rw-r--r--src/plugins/qmltooling/shared/abstractviewinspector.h4
2 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.cpp b/src/plugins/qmltooling/shared/abstractviewinspector.cpp
index c3eb24e659..d4c41b5084 100644
--- a/src/plugins/qmltooling/shared/abstractviewinspector.cpp
+++ b/src/plugins/qmltooling/shared/abstractviewinspector.cpp
@@ -60,14 +60,14 @@
// "showAppOnTop", "createObject", "destroyObject", "moveObject",
// "clearCache"}
// <DATA> : select: <debugIds_int_list>
-// reload: <list of relative paths w.r.t project of changed files>
-// <list of changed file contents>
+// reload: <hash<changed_filename_string, filecontents_bytearray>>
// setAnimationSpeed: <speed_real>
// showAppOnTop: <set_bool>
// createObject: <qml_string><parentId_int><imports_string_list><filename_string>
// destroyObject: <debugId_int>
// moveObject: <debugId_int><newParentId_int>
// clearCache: void
+// Response for "destroyObject" carries the <debugId_int> of the destroyed object.
const char REQUEST[] = "request";
const char RESPONSE[] = "response";
@@ -274,13 +274,13 @@ void AbstractViewInspector::onQmlObjectDestroyed(QObject *object)
if (!m_hashObjectsTobeDestroyed.contains(object))
return;
- int removeId = m_hashObjectsTobeDestroyed.take(object);
+ QPair<int, int> ids = m_hashObjectsTobeDestroyed.take(object);
QQmlDebugService::removeInvalidObjectsFromHash();
QByteArray response;
QQmlDebugStream rs(&response, QIODevice::WriteOnly);
- rs << QByteArray(RESPONSE) << removeId << true;
+ rs << QByteArray(RESPONSE) << ids.first << true << ids.second;
m_debugService->sendMessage(response);
}
@@ -346,7 +346,8 @@ void AbstractViewInspector::handleMessage(const QByteArray &message)
int debugId;
ds >> debugId;
if (QObject *obj = QQmlDebugService::objectForId(debugId)) {
- m_hashObjectsTobeDestroyed.insert(obj, requestId);
+ QPair<int, int> ids(requestId, debugId);
+ m_hashObjectsTobeDestroyed.insert(obj, ids);
connect(obj, SIGNAL(destroyed(QObject*)), SLOT(onQmlObjectDestroyed(QObject*)));
obj->deleteLater();
}
diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.h b/src/plugins/qmltooling/shared/abstractviewinspector.h
index ad42ba7a83..8eeb640e4e 100644
--- a/src/plugins/qmltooling/shared/abstractviewinspector.h
+++ b/src/plugins/qmltooling/shared/abstractviewinspector.h
@@ -126,8 +126,8 @@ private:
QList<AbstractTool *> m_tools;
int m_eventId;
int m_reloadEventId;
- // Hash< object to be destroyed, destroy eventId >
- QHash<QObject *, int> m_hashObjectsTobeDestroyed;
+ // Hash< object to be destroyed, QPair<destroy eventId, object debugId> >
+ QHash<QObject *, QPair<int, int> > m_hashObjectsTobeDestroyed;
};
} // namespace QmlJSDebugger