diff options
author | Chris Craig <ext-chris.craig@nokia.com> | 2012-05-29 14:42:07 -0400 |
---|---|---|
committer | Chris Craig <ext-chris.craig@nokia.com> | 2012-05-30 21:44:10 +0200 |
commit | b19fec0ecd76e36f21283c75c2ddbf265f6a11b5 (patch) | |
tree | 05ed1114440a55b524c433c18b1849572ac78cc1 | |
parent | 7212f36c6ee5bb45e05d1a88a34f7497d52aec96 (diff) |
Expose defaultEndpoint as a property for QML.
Also fixed a JsonConnection declarative test that failed because of a
previous commit.
Change-Id: Ibaecf3e5669a18519832b07628f4e23ca00d24cf
Reviewed-by: Alexei Rousskikh <ext-alexei.rousskikh@nokia.com>
Reviewed-by: Chris Craig <ext-chris.craig@nokia.com>
-rw-r--r-- | src/jsonconnection.h | 1 | ||||
-rw-r--r-- | tests/auto/jsonconnection/tst_jsonconnection.cpp | 21 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/jsonconnection.h b/src/jsonconnection.h index fdd7352..d6c43b5 100644 --- a/src/jsonconnection.h +++ b/src/jsonconnection.h @@ -63,6 +63,7 @@ class Q_ADDON_JSONSTREAM_EXPORT JsonConnection : public QObject Q_PROPERTY(bool useSeparateThreadForProcessing READ useSeparateThreadForProcessing WRITE setUseSeparateThreadForProcessing) Q_PROPERTY(qint64 readBufferSize READ readBufferSize WRITE setReadBufferSize) Q_PROPERTY(qint64 writeBufferSize READ writeBufferSize WRITE setWriteBufferSize) + Q_PROPERTY(JsonEndpoint * defaultEndpoint READ defaultEndpoint) public: JsonConnection(QObject *parent = 0); ~JsonConnection(); diff --git a/tests/auto/jsonconnection/tst_jsonconnection.cpp b/tests/auto/jsonconnection/tst_jsonconnection.cpp index 86e5e83..b32c7d2 100644 --- a/tests/auto/jsonconnection/tst_jsonconnection.cpp +++ b/tests/auto/jsonconnection/tst_jsonconnection.cpp @@ -547,21 +547,20 @@ static const char szDefaultData[] = endpointPropertyName: \"endpoint\" \n\ } \n\ \ - property variant prope; \n\ - prope: JsonEndpoint { \n\ - id: endpoint \n\ - connection: _connection \n\ - onReadyReadMessage: { \n\ - retmsg = endpoint.readMessageMap(); \n\ - retmsg.extra = \"extra\"; \n\ - retmsg.int++; \n\ - watcher.done(); \n\ - } \n\ + property variant conprop; \n\ + conprop: Connections { \n\ + target: _connection.defaultEndpoint \n\ + onReadyReadMessage: { \n\ + retmsg = _connection.defaultEndpoint.readMessageMap(); \n\ + retmsg.extra = \"extra\"; \n\ + retmsg.int++; \n\ + watcher.done(); \n\ + } \n\ } \n\ \ Component.onCompleted: { \n\ _connection.connectLocal(); \n\ - endpoint.send(msg); \n\ + _connection.defaultEndpoint.send(msg); \n\ } \n\ }"; |