Enabled the use of Debugger-specific watch/locals models.

- Modified WatchModel to handle storage of an hierarchy
  of WatchItems.
- Factored out code for asynchronous population to
  AsyncWatchModel and added a mixin for convenient
  handling
- Added base class for synchronous models.
- Implement simple, synchronous models for CDB, greatly
  simplifying code and finally getting manual
  expansion right.
Signed-off-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
Friedemann Kleint
2009-07-10 14:36:28 +02:00
parent b0227ce496
commit abf5e3ddc3
29 changed files with 1798 additions and 697 deletions

View File

@@ -30,6 +30,8 @@
#ifndef DEBUGGER_TCFENGINE_H
#define DEBUGGER_TCFENGINE_H
#include "asyncwatchmodel.h"
#include <QtCore/QByteArray>
#include <QtCore/QHash>
#include <QtCore/QMap>
@@ -112,10 +114,11 @@ private:
bool supportsThreads() const { return true; }
void maybeBreakNow(bool byFunction);
void updateWatchData(const WatchData &data);
void updateLocals();
void updateSubItem(const WatchData &data);
WatchModel *watchModel(int type) const { return m_models.model(type); }
Q_SLOT void socketConnected();
Q_SLOT void socketDisconnected();
Q_SLOT void socketError(QAbstractSocket::SocketError);
@@ -128,6 +131,7 @@ private:
private:
Q_SLOT void startDebugging();
Q_SLOT void updateWatchData(const WatchData &data);
typedef void (TcfEngine::*TcfCommandCallback)
(const JsonValue &record, const QVariant &cookie);
@@ -153,7 +157,7 @@ private:
QHash<int, TcfCommand> m_cookieForToken;
QQueue<TcfCommand> m_sendQueue;
// timer based congestion control. does not seem to work well.
void enqueueCommand(const TcfCommand &command);
Q_SLOT void handleSendTimer();
@@ -166,6 +170,7 @@ private:
DebuggerManager *q;
IDebuggerManagerAccessForEngines *qq;
AsyncWatchModelMixin m_models;
QTcpSocket *m_socket;
QByteArray m_inbuffer;
QList<QByteArray> m_services;