From 12788ffb2dafea1536efa49fd9e1b1c98898cd35 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 13 Apr 2016 15:13:54 +0200 Subject: Debugger: Avoid looking up references too often Multiple copies of lookup requests may accumulate when stepping too quickly, outsmarting the 'all updates done' logic, keeping Locals&Expressions in the grey 'update ongoing' state. Change-Id: Icec24ce1af8d273c3439ee91800ed1f4381ee19a Reviewed-by: Ulf Hermann (cherry picked from commit c1de315d6cbf8c94888aa4598d574ee2c3db272e) --- src/plugins/debugger/qml/qmlengine.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index e60af00690..3a12d27271 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -125,7 +125,7 @@ struct LookupData QByteArray exp; }; -typedef QMultiHash LookupItems; // id -> (iname, exp) +typedef QHash LookupItems; // id -> (iname, exp) class QmlEnginePrivate : QmlDebugClient { @@ -1375,8 +1375,14 @@ void QmlEnginePrivate::lookup(const LookupItems &items) if (items.isEmpty()) return; - QList handles = items.keys(); - currentlyLookingUp += items; + QList handles; + for (auto it = items.begin(); it != items.end(); ++it) { + const int handle = it.key(); + if (!currentlyLookingUp.contains(handle)) { + currentlyLookingUp.insert(handle, it.value()); + handles.append(handle); + } + } DebuggerCommand cmd(LOOKUP); cmd.arg(HANDLES, handles); -- cgit v1.2.1