diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2010-09-22 19:03:57 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2010-09-28 05:55:32 (GMT) |
commit | fd9771c29d401d88779ab7c5d7715c9ca41dd723 (patch) | |
tree | 0e96e0871e8914f5747bfc1a1314d76a78620b6d /src/declarative/debugger/qdeclarativedebug_p.h | |
parent | 7b796b4dcdebfba55c4754d241edb334217fc550 (diff) | |
download | Qt-fd9771c29d401d88779ab7c5d7715c9ca41dd723.zip Qt-fd9771c29d401d88779ab7c5d7715c9ca41dd723.tar.gz Qt-fd9771c29d401d88779ab7c5d7715c9ca41dd723.tar.bz2 |
Make QmlDebug protocol more robust
The protocol so far was client->server only. That is, there was no
sane way for a client to check whether a plugin on the server (service)
was available or not. E.g. calling Client::setEnabled(true) 'succeeded',
without a check whether there is actually a service to talk to.
The new protocol replaces this shortcoming by a service discovery
mechanism: Both client & service announce their available plugins at
handshake time, and later on if there are changes. The status is
reflected in Client::status() and Service::Status() , which are either
NotConnected - no network connection, or not registered properly
Unavailable - TCP/IP connection works, but no plugin with the same
name on the other side
Enabled - You can connect to plugin on other side
The status changes happen automatically (no setEnabled() anymore).
Furthermore a version ID was added to the handshake, so that we can
extend the protocol further in the future :)
Diffstat (limited to 'src/declarative/debugger/qdeclarativedebug_p.h')
-rw-r--r-- | src/declarative/debugger/qdeclarativedebug_p.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/declarative/debugger/qdeclarativedebug_p.h b/src/declarative/debugger/qdeclarativedebug_p.h index 2b1a115..3d83e8a 100644 --- a/src/declarative/debugger/qdeclarativedebug_p.h +++ b/src/declarative/debugger/qdeclarativedebug_p.h @@ -69,7 +69,11 @@ class Q_DECLARATIVE_EXPORT QDeclarativeEngineDebug : public QObject { Q_OBJECT public: - QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0); + enum Status { NotConnected, Unavailable, Enabled }; + + explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0); + + Status status() const; QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &, QObject *parent = 0); @@ -101,6 +105,7 @@ public: Q_SIGNALS: void newObjects(); + void statusChanged(Status status); private: Q_DECLARE_PRIVATE(QDeclarativeEngineDebug) |