diff --git a/src/libs/qmljsdebugclient/qdeclarativedebugclient.cpp b/src/libs/qmljsdebugclient/qdeclarativedebugclient.cpp index f12eaf6937e..c7a80b070b4 100644 --- a/src/libs/qmljsdebugclient/qdeclarativedebugclient.cpp +++ b/src/libs/qmljsdebugclient/qdeclarativedebugclient.cpp @@ -222,6 +222,12 @@ qint64 QDeclarativeDebugConnection::writeData(const char *data, qint64 maxSize) return d->device->write(data, maxSize); } +void QDeclarativeDebugConnection::internalError(QAbstractSocket::SocketError socketError) +{ + setErrorString(d->device->errorString()); + emit error(socketError); +} + qint64 QDeclarativeDebugConnection::bytesAvailable() const { return d->device->bytesAvailable(); @@ -300,7 +306,7 @@ void QDeclarativeDebugConnection::connectToHost(const QString &hostName, quint16 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(error(QAbstractSocket::SocketError)), this, SLOT(internalError(QAbstractSocket::SocketError))); connect(socket, SIGNAL(connected()), this, SIGNAL(connected())); socket->connectToHost(hostName, port); QIODevice::open(ReadWrite | Unbuffered); diff --git a/src/libs/qmljsdebugclient/qdeclarativedebugclient.h b/src/libs/qmljsdebugclient/qdeclarativedebugclient.h index fe118de535e..57a331c5ab4 100644 --- a/src/libs/qmljsdebugclient/qdeclarativedebugclient.h +++ b/src/libs/qmljsdebugclient/qdeclarativedebugclient.h @@ -66,6 +66,9 @@ protected: qint64 readData(char *data, qint64 maxSize); qint64 writeData(const char *data, qint64 maxSize); +private slots: + void internalError(QAbstractSocket::SocketError error); + private: QDeclarativeDebugConnectionPrivate *d; friend class QDeclarativeDebugClient;