aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/debugger/shared/qqmldebugclient.cpp')
-rw-r--r--tests/auto/qml/debugger/shared/qqmldebugclient.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qml/debugger/shared/qqmldebugclient.cpp b/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
index be3042311b..95674ce6d7 100644
--- a/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
+++ b/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
@@ -325,6 +325,23 @@ bool QQmlDebugConnection::waitForConnected(int msecs)
return d->gotHello;
}
+QString QQmlDebugConnection::stateString() const
+{
+ QString state;
+
+ if (isConnected())
+ state = "Connected";
+ else
+ state = "Not connected";
+
+ if (d->gotHello)
+ state += ", got hello";
+ else
+ state += ", did not get hello!";
+
+ return state;
+}
+
QAbstractSocket::SocketState QQmlDebugConnection::state() const
{
QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(d->device);
@@ -425,6 +442,15 @@ QQmlDebugClient::State QQmlDebugClient::state() const
return Unavailable;
}
+QString QQmlDebugClient::stateString() const
+{
+ switch (state()) {
+ case NotConnected: return QLatin1String("Not connected");
+ case Unavailable: return QLatin1String("Unavailable");
+ case Enabled: return QLatin1String("Enabled");
+ }
+}
+
void QQmlDebugClient::sendMessage(const QByteArray &message)
{
if (state() != Enabled)