forked from qt-creator/qt-creator
Debugger: Compress consecutive calls to updateLocalsWindow()
When expanding all children of a long array, this is called once per item. If we have one update in the end that's enough. Change-Id: Ibb63a9aef752418a1dcafb6190edf5a8005a855f Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -469,6 +469,7 @@ public:
|
||||
|
||||
QSet<QString> m_expandedINames;
|
||||
QTimer m_requestUpdateTimer;
|
||||
QTimer m_localsWindowsTimer;
|
||||
|
||||
QHash<QString, TypeInfo> m_reportedTypeInfo;
|
||||
QHash<QString, DisplayFormats> m_reportedTypeFormats; // Type name -> Dumper Formats
|
||||
@@ -515,6 +516,14 @@ WatchModel::WatchModel(WatchHandler *handler, DebuggerEngine *engine)
|
||||
connect(&m_requestUpdateTimer, &QTimer::timeout,
|
||||
this, &WatchModel::updateStarted);
|
||||
|
||||
m_localsWindowsTimer.setSingleShot(true);
|
||||
m_localsWindowsTimer.setInterval(50);
|
||||
connect(&m_localsWindowsTimer, &QTimer::timeout, this, [this] {
|
||||
// Force show/hide of return view.
|
||||
const bool showReturn = m_returnRoot->childCount() != 0;
|
||||
m_engine->updateLocalsWindow(showReturn);
|
||||
});
|
||||
|
||||
DebuggerSettings &s = *debuggerSettings();
|
||||
connect(&s.sortStructMembers, &BaseAspect::changed,
|
||||
m_engine, &DebuggerEngine::updateLocals);
|
||||
@@ -2559,9 +2568,7 @@ void WatchModel::clearWatches()
|
||||
|
||||
void WatchHandler::updateLocalsWindow()
|
||||
{
|
||||
// Force show/hide of return view.
|
||||
bool showReturn = m_model->m_returnRoot->childCount() != 0;
|
||||
m_engine->updateLocalsWindow(showReturn);
|
||||
m_model->m_localsWindowsTimer.start();
|
||||
}
|
||||
|
||||
QStringList WatchHandler::watchedExpressions()
|
||||
|
Reference in New Issue
Block a user