From 388a21c82646f6684dbd51f7fcfc9f5cd45c01af Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Tue, 9 Oct 2012 16:13:29 +0200 Subject: QmlDebugger: Insert locals correctly The watchhandler needs to be reset for locals before inserting the values of a new frame. Also the DebuggerTooltipManager needs to be notified. The values of the locals in the LocalsAndExpressions window should be editable. Task-number: QTCREATORBUG-7992 Change-Id: I556e23b408db09b510f1f2bc350ff55187ec87c2 Reviewed-by: Robert Loehning Reviewed-by: Christiaan Janssen --- src/plugins/debugger/qml/qmlv8debuggerclient.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/plugins/debugger/qml/qmlv8debuggerclient.cpp') diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp index ea47c72c35..79360a6b16 100644 --- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp +++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp @@ -1186,6 +1186,7 @@ void QmlV8DebuggerClient::expandObject(const QByteArray &iname, quint64 objectId void QmlV8DebuggerClient::setEngine(QmlEngine *engine) { d->engine = engine; + connect(this, SIGNAL(stackFrameCompleted()), engine, SIGNAL(stackFrameCompleted())); } void QmlV8DebuggerClient::getSourceFiles() @@ -1682,8 +1683,17 @@ void QmlV8DebuggerClient::setCurrentFrameDetails(const QVariant &bodyVal, const QVariantMap currentFrame = bodyVal.toMap(); StackHandler *stackHandler = d->engine->stackHandler(); - + WatchHandler * watchHandler = d->engine->watchHandler(); d->clearCache(); + + const int frameIndex = stackHandler->currentIndex(); + watchHandler->removeAllData(); + if (frameIndex < 0) + return; + const StackFrame frame = stackHandler->currentFrame(); + if (!frame.isUsable()) + return; + //Set "this" variable { WatchData data; @@ -1702,7 +1712,7 @@ void QmlV8DebuggerClient::setCurrentFrameDetails(const QVariant &bodyVal, const data.setHasChildren(true); data.id = 0; } - d->engine->watchHandler()->insertData(data); + watchHandler->insertData(data); } const QVariantList currentFrameScopes = currentFrame.value(_("scopes")).toList(); @@ -1716,6 +1726,7 @@ void QmlV8DebuggerClient::setCurrentFrameDetails(const QVariant &bodyVal, const d->scope(scopeIndex); } d->engine->gotoLocation(stackHandler->currentFrame()); + emit stackFrameCompleted(); } void QmlV8DebuggerClient::updateScope(const QVariant &bodyVal, const QVariant &refsVal) -- cgit v1.2.1