aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-11-02 15:45:18 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-11-03 10:44:56 +0000
commitccc4fe54e51dfd19cb266a7cae5f130f9c3929af (patch)
tree58c1701d4a5f07742b2f81688d1c2ad07af0cab4 /src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
parentb85d8290a78d2c2e0ce34cf33a99b99c05bb88a0 (diff)
QmlProfiler: Delete debug connection on error or if params change
Now that we don't recreate the debug connection anymore when (re)trying to connect, we have to do it explicitly when changing the connection parameters or when a connection attempt fails and we need to cancel the "Connecting" state. Change-Id: Ib2b6b4fb1e39e64fe3c9f2bf90b6e43043d05a9e Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
index a81b092a1d..04f2ac0eb6 100644
--- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
@@ -105,6 +105,7 @@ void QmlProfilerClientManager::setTcpConnection(QString host, quint64 port)
{
d->tcpHost = host;
d->tcpPort = port;
+ disconnectClient();
}
void QmlProfilerClientManager::clearBufferedData()
@@ -135,6 +136,8 @@ void QmlProfilerClientManager::connectClient(quint16 port)
connect(d->connection, SIGNAL(errorMessage(QString)), this, SLOT(logState(QString)));
connect(d->connection, SIGNAL(opened()), this, SLOT(qmlDebugConnectionOpened()));
connect(d->connection, SIGNAL(closed()), this, SLOT(qmlDebugConnectionClosed()));
+ connect(d->connection, &QmlDebugConnection::error,
+ this, &QmlProfilerClientManager::qmlDebugConnectionError);
d->connectionTimer.start();
d->tcpPort = port;
}
@@ -276,6 +279,17 @@ void QmlProfilerClientManager::qmlDebugConnectionClosed()
emit connectionClosed();
}
+void QmlProfilerClientManager::qmlDebugConnectionError(QDebugSupport::Error error)
+{
+ logState(tr("Debug connection error %1").arg(error));
+ if (d->connection->isOpen()) {
+ disconnectClient();
+ emit connectionClosed();
+ } else {
+ disconnectClient();
+ }
+}
+
void QmlProfilerClientManager::logState(const QString &msg)
{
QString state = QLatin1String("QML Profiler: ") + msg;