QmlDbg: Fix behavior when re-running the same run control

Change-Id: Icb405b4751fc885d8b96d1daec3653236b564ef0
Reviewed-on: http://codereview.qt.nokia.com/2352
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
Kai Koehne
2011-07-28 17:04:35 +02:00
parent 4453554cf4
commit 289acee78a
3 changed files with 53 additions and 42 deletions

View File

@@ -237,6 +237,11 @@ void QDeclarativeDebugConnection::close()
QIODevice::close();
d->device->close();
emit stateChanged(QAbstractSocket::UnconnectedState);
QHash<QString, QDeclarativeDebugClient*>::iterator iter = d->plugins.begin();
for (; iter != d->plugins.end(); ++iter) {
iter.value()->statusChanged(QDeclarativeDebugClient::NotConnected);
}
}
}
@@ -283,6 +288,7 @@ void QDeclarativeDebugConnection::connectToHost(const QString &hostName, quint16
QTcpSocket *socket = new QTcpSocket(d);
d->device = socket;
d->connectDeviceSignals();
d->gotHello = false;
connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SIGNAL(stateChanged(QAbstractSocket::SocketState)));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SIGNAL(error(QAbstractSocket::SocketError)));
connect(socket, SIGNAL(connected()), this, SIGNAL(connected()));
@@ -297,6 +303,7 @@ void QDeclarativeDebugConnection::connectToOst(const QString &port)
ost->setParent(d);
d->device = ost;
d->connectDeviceSignals();
d->gotHello = false;
QIODevice::open(ReadWrite | Unbuffered);
emit stateChanged(QAbstractSocket::ConnectedState);
emit connected();