diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-16 17:29:17 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-19 11:32:46 +0000 |
commit | 81eea72d44531107ace4ae4a3c525ff6b9cd23cc (patch) | |
tree | f0de5d2423709e264adf188b4a519bce45c363d5 /src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp | |
parent | 47317eff60619d762c54f9dc7e472431b2a86c2a (diff) |
QmlDebug: Simplify error and state signaling
There is no point in sending two signals for every state change and
error. Also, the signals only reflect events in the socket, not in the
logical connection.
Change-Id: I617a925c69164aa1a02a7781b9da7dca55daa304
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp index f104dda4e4..887ba0f3b7 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp @@ -32,7 +32,6 @@ #include "qmlprofilertool.h" #include "qmlprofilerplugin.h" -#include <qmldebug/qmldebugclient.h> #include <qmldebug/qmlprofilertraceclient.h> #include <utils/qtcassert.h> @@ -132,16 +131,14 @@ void QmlProfilerClientManager::connectClient(quint16 port) d->connection = new QmlDebugConnection; enableServices(); - connect(d->connection, &QmlDebugConnection::stateMessage, - this, &QmlProfilerClientManager::logState); - connect(d->connection, &QmlDebugConnection::errorMessage, - this, &QmlProfilerClientManager::logState); connect(d->connection, &QmlDebugConnection::connected, this, &QmlProfilerClientManager::qmlDebugConnectionOpened); connect(d->connection, &QmlDebugConnection::disconnected, this, &QmlProfilerClientManager::qmlDebugConnectionClosed); - connect(d->connection, &QmlDebugConnection::error, + connect(d->connection, &QmlDebugConnection::socketError, this, &QmlProfilerClientManager::qmlDebugConnectionError); + connect(d->connection, &QmlDebugConnection::socketStateChanged, + this, &QmlProfilerClientManager::qmlDebugConnectionStateChanged); d->connectionTimer.start(); d->tcpPort = port; } @@ -273,9 +270,9 @@ void QmlProfilerClientManager::qmlDebugConnectionClosed() emit connectionClosed(); } -void QmlProfilerClientManager::qmlDebugConnectionError(QDebugSupport::Error error) +void QmlProfilerClientManager::qmlDebugConnectionError(QAbstractSocket::SocketError error) { - logState(tr("Debug connection error %1").arg(error)); + logState(QmlDebugConnection::socketErrorToString(error)); if (d->connection->isConnected()) { disconnectClient(); emit connectionClosed(); @@ -284,6 +281,11 @@ void QmlProfilerClientManager::qmlDebugConnectionError(QDebugSupport::Error erro } } +void QmlProfilerClientManager::qmlDebugConnectionStateChanged(QAbstractSocket::SocketState state) +{ + logState(QmlDebugConnection::socketStateToString(state)); +} + void QmlProfilerClientManager::logState(const QString &msg) { QString state = QLatin1String("QML Profiler: ") + msg; |