Commit 9851484b authored by hjk's avatar hjk

Debugger: Remove new watch window timer from public interface

Change-Id: Ic9d3df22d917e5644d6302a6af06aa8eadea8b5a
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent f1ea4155
...@@ -1500,7 +1500,7 @@ void CdbEngine::updateLocals(bool newFrame) ...@@ -1500,7 +1500,7 @@ void CdbEngine::updateLocals(bool newFrame)
// Required arguments: frame // Required arguments: frame
str << blankSeparator << frameIndex; str << blankSeparator << frameIndex;
watchHandler()->updateRequested(); watchHandler()->notifyUpdateStarted();
postExtensionCommand("locals", arguments, 0, postExtensionCommand("locals", arguments, 0,
[this, newFrame](const CdbResponse &r) { handleLocals(r, newFrame); }); [this, newFrame](const CdbResponse &r) { handleLocals(r, newFrame); });
} }
...@@ -1860,7 +1860,7 @@ void CdbEngine::handleRegistersExt(const CdbResponse &response) ...@@ -1860,7 +1860,7 @@ void CdbEngine::handleRegistersExt(const CdbResponse &response)
void CdbEngine::handleLocals(const CdbResponse &response, bool newFrame) void CdbEngine::handleLocals(const CdbResponse &response, bool newFrame)
{ {
if (response.success) { if (response.success) {
watchHandler()->updateFinished(); watchHandler()->notifyUpdateFinished();
if (boolSetting(VerboseLog)) if (boolSetting(VerboseLog))
showMessage(QLatin1String("Locals: ") + QString::fromLatin1(response.extensionReply), LogDebug); showMessage(QLatin1String("Locals: ") + QString::fromLatin1(response.extensionReply), LogDebug);
WatchHandler *handler = watchHandler(); WatchHandler *handler = watchHandler();
......
...@@ -3755,7 +3755,7 @@ void GdbEngine::handleVarAssign(const DebuggerResponse &) ...@@ -3755,7 +3755,7 @@ void GdbEngine::handleVarAssign(const DebuggerResponse &)
void GdbEngine::updateLocals() void GdbEngine::updateLocals()
{ {
watchHandler()->resetValueCache(); watchHandler()->resetValueCache();
watchHandler()->updateRequested(); watchHandler()->notifyUpdateStarted();
updateLocalsPython(UpdateParameters()); updateLocalsPython(UpdateParameters());
} }
...@@ -4768,7 +4768,7 @@ void GdbEngine::updateLocalsPython(const UpdateParameters &params) ...@@ -4768,7 +4768,7 @@ void GdbEngine::updateLocalsPython(const UpdateParameters &params)
void GdbEngine::handleStackFramePython(const DebuggerResponse &response, bool partial) void GdbEngine::handleStackFramePython(const DebuggerResponse &response, bool partial)
{ {
watchHandler()->updateFinished(); watchHandler()->notifyUpdateFinished();
if (response.resultClass == ResultDone) { if (response.resultClass == ResultDone) {
QByteArray out = response.consoleStreamOutput; QByteArray out = response.consoleStreamOutput;
while (out.endsWith(' ') || out.endsWith('\n')) while (out.endsWith(' ') || out.endsWith('\n'))
......
...@@ -912,7 +912,7 @@ void LldbEngine::doUpdateLocals(UpdateParameters params) ...@@ -912,7 +912,7 @@ void LldbEngine::doUpdateLocals(UpdateParameters params)
m_lastDebuggableCommand = cmd; m_lastDebuggableCommand = cmd;
m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1"); m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1");
watchHandler()->updateRequested(); watchHandler()->notifyUpdateStarted();
runCommand(cmd); runCommand(cmd);
reloadRegisters(); reloadRegisters();
...@@ -1010,7 +1010,7 @@ void LldbEngine::refreshLocals(const GdbMi &vars) ...@@ -1010,7 +1010,7 @@ void LldbEngine::refreshLocals(const GdbMi &vars)
} }
handler->purgeOutdatedItems(toDelete); handler->purgeOutdatedItems(toDelete);
handler->updateFinished(); handler->notifyUpdateFinished();
DebuggerToolTipManager::updateEngine(this); DebuggerToolTipManager::updateEngine(this);
} }
......
...@@ -664,7 +664,7 @@ void PdbEngine::updateLocals() ...@@ -664,7 +664,7 @@ void PdbEngine::updateLocals()
//m_lastDebuggableCommand = cmd; //m_lastDebuggableCommand = cmd;
//m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1"); //m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1");
watchHandler()->updateRequested(); watchHandler()->notifyUpdateStarted();
runCommand(cmd); runCommand(cmd);
} }
......
...@@ -228,6 +228,7 @@ public: ...@@ -228,6 +228,7 @@ public:
WatchItem *m_tooltipRoot; // Not owned. WatchItem *m_tooltipRoot; // Not owned.
QSet<QByteArray> m_expandedINames; QSet<QByteArray> m_expandedINames;
QTimer m_requestUpdateTimer;
TypeFormatList builtinTypeFormatList(const WatchData &data) const; TypeFormatList builtinTypeFormatList(const WatchData &data) const;
QStringList dumperTypeFormatList(const WatchData &data) const; QStringList dumperTypeFormatList(const WatchData &data) const;
...@@ -257,6 +258,10 @@ WatchModel::WatchModel(WatchHandler *handler) ...@@ -257,6 +258,10 @@ WatchModel::WatchModel(WatchHandler *handler)
root->appendChild(m_tooltipRoot = new WatchItem("tooltip", tr("Tooltip"))); root->appendChild(m_tooltipRoot = new WatchItem("tooltip", tr("Tooltip")));
setRootItem(root); setRootItem(root);
m_requestUpdateTimer.setSingleShot(true);
connect(&m_requestUpdateTimer, &QTimer::timeout,
this, &WatchModel::updateStarted);
connect(action(SortStructMembers), &SavedAction::valueChanged, connect(action(SortStructMembers), &SavedAction::valueChanged,
this, &WatchModel::reinsertAllData); this, &WatchModel::reinsertAllData);
connect(action(ShowStdNamespace), &SavedAction::valueChanged, connect(action(ShowStdNamespace), &SavedAction::valueChanged,
...@@ -1161,9 +1166,6 @@ WatchHandler::WatchHandler(DebuggerEngine *engine) ...@@ -1161,9 +1166,6 @@ WatchHandler::WatchHandler(DebuggerEngine *engine)
m_contentsValid = true; // FIXME m_contentsValid = true; // FIXME
m_resetLocationScheduled = false; m_resetLocationScheduled = false;
m_separatedView = new SeparatedView; m_separatedView = new SeparatedView;
m_requestUpdateTimer = new QTimer(this);
m_requestUpdateTimer->setSingleShot(true);
connect(m_requestUpdateTimer, &QTimer::timeout, m_model, &WatchModel::updateRequested);
} }
WatchHandler::~WatchHandler() WatchHandler::~WatchHandler()
...@@ -1276,14 +1278,14 @@ void WatchHandler::resetValueCache() ...@@ -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(); emit m_model->updateFinished();
} }
......
...@@ -38,10 +38,6 @@ ...@@ -38,10 +38,6 @@
#include <QPointer> #include <QPointer>
#include <QVector> #include <QVector>
QT_BEGIN_NAMESPACE
class QTimer;
QT_END_NAMESPACE
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
...@@ -181,7 +177,7 @@ signals: ...@@ -181,7 +177,7 @@ signals:
void itemIsExpanded(const QModelIndex &idx); void itemIsExpanded(const QModelIndex &idx);
void inameIsExpanded(const QByteArray &iname); void inameIsExpanded(const QByteArray &iname);
void columnAdjustmentRequested(); void columnAdjustmentRequested();
void updateRequested(); void updateStarted();
void updateFinished(); void updateFinished();
}; };
...@@ -248,8 +244,8 @@ public: ...@@ -248,8 +244,8 @@ public:
void removeItemByIName(const QByteArray &iname); void removeItemByIName(const QByteArray &iname);
void removeAllData(bool includeInspectData = false); void removeAllData(bool includeInspectData = false);
void resetValueCache(); void resetValueCache();
void updateRequested(); void notifyUpdateStarted();
void updateFinished(); void notifyUpdateFinished();
void purgeOutdatedItems(const QSet<QByteArray> &inames); void purgeOutdatedItems(const QSet<QByteArray> &inames);
private: private:
...@@ -264,7 +260,6 @@ private: ...@@ -264,7 +260,6 @@ private:
WatchModel *m_model; // Owned. WatchModel *m_model; // Owned.
DebuggerEngine *m_engine; // Not owned. DebuggerEngine *m_engine; // Not owned.
SeparatedView *m_separatedView; // Owned. SeparatedView *m_separatedView; // Owned.
QTimer *m_requestUpdateTimer; // Owned.
bool m_contentsValid; bool m_contentsValid;
bool m_resetLocationScheduled; bool m_resetLocationScheduled;
......
...@@ -953,7 +953,7 @@ void WatchTreeView::setModel(QAbstractItemModel *model) ...@@ -953,7 +953,7 @@ void WatchTreeView::setModel(QAbstractItemModel *model)
connect(watchModel, &WatchModelBase::itemIsExpanded, connect(watchModel, &WatchModelBase::itemIsExpanded,
this, &WatchTreeView::handleItemIsExpanded); this, &WatchTreeView::handleItemIsExpanded);
if (m_type == LocalsType) { if (m_type == LocalsType) {
connect(watchModel, &WatchModelBase::updateRequested, connect(watchModel, &WatchModelBase::updateStarted,
this, &WatchTreeView::showProgressIndicator); this, &WatchTreeView::showProgressIndicator);
connect(watchModel, &WatchModelBase::updateFinished, connect(watchModel, &WatchModelBase::updateFinished,
this, &WatchTreeView::hideProgressIndicator); this, &WatchTreeView::hideProgressIndicator);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment