diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 2beaa27b5006c77d2c5ba7b0e7dda126ea64a91b..657972e89948d6170423c0712ceaa962abfedfb1 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -1500,7 +1500,7 @@ void CdbEngine::updateLocals(bool newFrame) // Required arguments: frame str << blankSeparator << frameIndex; - watchHandler()->updateRequested(); + watchHandler()->notifyUpdateStarted(); postExtensionCommand("locals", arguments, 0, [this, newFrame](const CdbResponse &r) { handleLocals(r, newFrame); }); } @@ -1860,7 +1860,7 @@ void CdbEngine::handleRegistersExt(const CdbResponse &response) void CdbEngine::handleLocals(const CdbResponse &response, bool newFrame) { if (response.success) { - watchHandler()->updateFinished(); + watchHandler()->notifyUpdateFinished(); if (boolSetting(VerboseLog)) showMessage(QLatin1String("Locals: ") + QString::fromLatin1(response.extensionReply), LogDebug); WatchHandler *handler = watchHandler(); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 3ba9d5092859ef33442561818ccf4f0965403e75..040d1e7152cef89094b60d25d3307db38ffbe0d0 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3755,7 +3755,7 @@ void GdbEngine::handleVarAssign(const DebuggerResponse &) void GdbEngine::updateLocals() { watchHandler()->resetValueCache(); - watchHandler()->updateRequested(); + watchHandler()->notifyUpdateStarted(); updateLocalsPython(UpdateParameters()); } @@ -4768,7 +4768,7 @@ void GdbEngine::updateLocalsPython(const UpdateParameters ¶ms) void GdbEngine::handleStackFramePython(const DebuggerResponse &response, bool partial) { - watchHandler()->updateFinished(); + watchHandler()->notifyUpdateFinished(); if (response.resultClass == ResultDone) { QByteArray out = response.consoleStreamOutput; while (out.endsWith(' ') || out.endsWith('\n')) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index a9fbab5d990794fa58f86cd93fec90f892d2cc03..de7399b034a1a2f4dc0d75679e5e4a96625d792a 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -912,7 +912,7 @@ void LldbEngine::doUpdateLocals(UpdateParameters params) m_lastDebuggableCommand = cmd; m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1"); - watchHandler()->updateRequested(); + watchHandler()->notifyUpdateStarted(); runCommand(cmd); reloadRegisters(); @@ -1010,7 +1010,7 @@ void LldbEngine::refreshLocals(const GdbMi &vars) } handler->purgeOutdatedItems(toDelete); - handler->updateFinished(); + handler->notifyUpdateFinished(); DebuggerToolTipManager::updateEngine(this); } diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp index ee5afb470dd3b310a9ca7223f1932f013c4ddaf5..c4bb9acd6897253d1ddf89e1f0c984b5b501ec7c 100644 --- a/src/plugins/debugger/pdb/pdbengine.cpp +++ b/src/plugins/debugger/pdb/pdbengine.cpp @@ -664,7 +664,7 @@ void PdbEngine::updateLocals() //m_lastDebuggableCommand = cmd; //m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1"); - watchHandler()->updateRequested(); + watchHandler()->notifyUpdateStarted(); runCommand(cmd); } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 8d9e900313e8672cdc1ff0d36cae90c3f107fe50..abb86fc645f483b107846c2504d85f09d4196520 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -228,6 +228,7 @@ public: WatchItem *m_tooltipRoot; // Not owned. QSet<QByteArray> m_expandedINames; + QTimer m_requestUpdateTimer; TypeFormatList builtinTypeFormatList(const WatchData &data) const; QStringList dumperTypeFormatList(const WatchData &data) const; @@ -257,6 +258,10 @@ WatchModel::WatchModel(WatchHandler *handler) root->appendChild(m_tooltipRoot = new WatchItem("tooltip", tr("Tooltip"))); setRootItem(root); + m_requestUpdateTimer.setSingleShot(true); + connect(&m_requestUpdateTimer, &QTimer::timeout, + this, &WatchModel::updateStarted); + connect(action(SortStructMembers), &SavedAction::valueChanged, this, &WatchModel::reinsertAllData); connect(action(ShowStdNamespace), &SavedAction::valueChanged, @@ -1161,9 +1166,6 @@ WatchHandler::WatchHandler(DebuggerEngine *engine) m_contentsValid = true; // FIXME m_resetLocationScheduled = false; m_separatedView = new SeparatedView; - m_requestUpdateTimer = new QTimer(this); - m_requestUpdateTimer->setSingleShot(true); - connect(m_requestUpdateTimer, &QTimer::timeout, m_model, &WatchModel::updateRequested); } WatchHandler::~WatchHandler() @@ -1276,14 +1278,14 @@ void WatchHandler::resetValueCache() }); } -void WatchHandler::updateRequested() +void WatchHandler::notifyUpdateStarted() { - m_requestUpdateTimer->start(80); + m_model->m_requestUpdateTimer.start(80); } -void WatchHandler::updateFinished() +void WatchHandler::notifyUpdateFinished() { - m_requestUpdateTimer->stop(); + m_model->m_requestUpdateTimer.stop(); emit m_model->updateFinished(); } diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 4f898c3933105815992bc100fc385fd6980dea25..1faaabb542de081d6e3a532c094baedbfe86a69d 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -38,10 +38,6 @@ #include <QPointer> #include <QVector> -QT_BEGIN_NAMESPACE -class QTimer; -QT_END_NAMESPACE - namespace Debugger { namespace Internal { @@ -181,7 +177,7 @@ signals: void itemIsExpanded(const QModelIndex &idx); void inameIsExpanded(const QByteArray &iname); void columnAdjustmentRequested(); - void updateRequested(); + void updateStarted(); void updateFinished(); }; @@ -248,8 +244,8 @@ public: void removeItemByIName(const QByteArray &iname); void removeAllData(bool includeInspectData = false); void resetValueCache(); - void updateRequested(); - void updateFinished(); + void notifyUpdateStarted(); + void notifyUpdateFinished(); void purgeOutdatedItems(const QSet<QByteArray> &inames); private: @@ -264,7 +260,6 @@ private: WatchModel *m_model; // Owned. DebuggerEngine *m_engine; // Not owned. SeparatedView *m_separatedView; // Owned. - QTimer *m_requestUpdateTimer; // Owned. bool m_contentsValid; bool m_resetLocationScheduled; diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 90c376b8286402904681ac96e4e32b1f4799378e..6ff501c61e3427dbdfeabe66892b120f8cc752a2 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -953,7 +953,7 @@ void WatchTreeView::setModel(QAbstractItemModel *model) connect(watchModel, &WatchModelBase::itemIsExpanded, this, &WatchTreeView::handleItemIsExpanded); if (m_type == LocalsType) { - connect(watchModel, &WatchModelBase::updateRequested, + connect(watchModel, &WatchModelBase::updateStarted, this, &WatchTreeView::showProgressIndicator); connect(watchModel, &WatchModelBase::updateFinished, this, &WatchTreeView::hideProgressIndicator);