aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/shared
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2012-04-23 09:23:23 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-26 11:46:06 +0200
commit7f7cd79e29e634ddff55fe18b122ac85c5cfe4a0 (patch)
treec6914c9a28eaec0e07309cfdfd60b9da0388912b /tests/auto/qml/debugger/shared
parentc0f07d5707180856bb2705359d780a836653188c (diff)
QmlDebugging: Exchange supported QDataStream versions
Since the client and service needs to pack/unpack datastreams, they need to encode/decode using the lowest common QDataStream version. Change-Id: I3b4886fece59b24950ba618da07a0fefd41a5637 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'tests/auto/qml/debugger/shared')
-rw-r--r--tests/auto/qml/debugger/shared/qqmldebugclient.cpp17
-rw-r--r--tests/auto/qml/debugger/shared/qqmldebugclient.h5
2 files changed, 20 insertions, 2 deletions
diff --git a/tests/auto/qml/debugger/shared/qqmldebugclient.cpp b/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
index f0fa499b9f..e36d596a49 100644
--- a/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
+++ b/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
@@ -112,7 +112,8 @@ void QQmlDebugConnectionPrivate::advertisePlugins()
void QQmlDebugConnectionPrivate::connected()
{
QPacket pack;
- pack << serverId << 0 << protocolVersion << plugins.keys();
+ pack << serverId << 0 << protocolVersion << plugins.keys()
+ << q->m_dataStreamVersion;
protocol->send(pack);
q->flush();
}
@@ -148,6 +149,7 @@ void QQmlDebugConnectionPrivate::readyRead()
serverPlugins.insert(pluginNames.at(i), pluginVersion);
}
+ pack >> q->m_dataStreamVersion;
validHello = true;
}
}
@@ -247,7 +249,8 @@ void QQmlDebugConnectionPrivate::handshakeTimeout()
}
QQmlDebugConnection::QQmlDebugConnection(QObject *parent)
- : QIODevice(parent), d(new QQmlDebugConnectionPrivate(this))
+ : QIODevice(parent), d(new QQmlDebugConnectionPrivate(this)),
+ m_dataStreamVersion(QDataStream::Qt_5_0)
{
}
@@ -260,6 +263,16 @@ QQmlDebugConnection::~QQmlDebugConnection()
}
}
+void QQmlDebugConnection::setDataStreamVersion(int dataStreamVersion)
+{
+ m_dataStreamVersion = dataStreamVersion;
+}
+
+int QQmlDebugConnection::dataStreamVersion()
+{
+ return m_dataStreamVersion;
+}
+
bool QQmlDebugConnection::isConnected() const
{
return state() == QAbstractSocket::ConnectedState;
diff --git a/tests/auto/qml/debugger/shared/qqmldebugclient.h b/tests/auto/qml/debugger/shared/qqmldebugclient.h
index 0f140a1db1..5275d41431 100644
--- a/tests/auto/qml/debugger/shared/qqmldebugclient.h
+++ b/tests/auto/qml/debugger/shared/qqmldebugclient.h
@@ -55,6 +55,9 @@ public:
void connectToHost(const QString &hostName, quint16 port);
+ void setDataStreamVersion(int dataStreamVersion);
+ int dataStreamVersion();
+
qint64 bytesAvailable() const;
bool isConnected() const;
QAbstractSocket::SocketState state() const;
@@ -74,8 +77,10 @@ protected:
private:
QQmlDebugConnectionPrivate *d;
+ int m_dataStreamVersion;
friend class QQmlDebugClient;
friend class QQmlDebugClientPrivate;
+ friend class QQmlDebugConnectionPrivate;
};
class QQmlDebugClientPrivate;