From 79ed2f70f05d30b82c0cec8843f5431cf8224f1c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 16 Sep 2015 16:28:24 +0200 Subject: Move QQmlDebugClient into separate static library Change-Id: Ib3daf9da2cf6798bd022cfcf54d11e565c9cb4ca Reviewed-by: Simon Hausmann --- tests/auto/qml/debugger/shared/debugutil.cpp | 50 +++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) (limited to 'tests/auto/qml/debugger/shared/debugutil.cpp') diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index 51d706b818..54720fc848 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -33,10 +33,12 @@ #include "debugutil_p.h" -#include -#include -#include -#include +#include + +#include +#include +#include +#include bool QQmlDebugTest::waitForSignal(QObject *receiver, const char *member, int timeout) { QEventLoop loop; @@ -51,6 +53,46 @@ bool QQmlDebugTest::waitForSignal(QObject *receiver, const char *member, int tim return timer.isActive(); } +QList QQmlDebugTest::createOtherClients(QQmlDebugConnection *connection) +{ + QList ret; + foreach (const QString &service, QQmlDebuggingEnabler::debuggerServices()) { + if (!connection->client(service)) + ret << new QQmlDebugClient(service, connection); + } + foreach (const QString &service, QQmlDebuggingEnabler::inspectorServices()) { + if (!connection->client(service)) + ret << new QQmlDebugClient(service, connection); + } + foreach (const QString &service, QQmlDebuggingEnabler::profilerServices()) { + if (!connection->client(service)) + ret << new QQmlDebugClient(service, connection); + } + return ret; +} + +QString QQmlDebugTest::clientStateString(const QQmlDebugClient *client) +{ + if (!client) + return QLatin1String("null"); + + switch (client->state()) { + case QQmlDebugClient::NotConnected: return QLatin1String("Not connected"); + case QQmlDebugClient::Unavailable: return QLatin1String("Unavailable"); + case QQmlDebugClient::Enabled: return QLatin1String("Enabled"); + default: return QLatin1String("Invalid"); + } + +} + +QString QQmlDebugTest::connectionStateString(const QQmlDebugConnection *connection) +{ + if (!connection) + return QLatin1String("null"); + + return connection->isConnected() ? QLatin1String("connected") : QLatin1String("not connected"); +} + QQmlDebugTestClient::QQmlDebugTestClient(const QString &s, QQmlDebugConnection *c) : QQmlDebugClient(s, c) { -- cgit v1.2.3