QDeclarativeDebugClient: Expose internal error string

Forward error string from real device to QDeclarativeDebugClient.

Change-Id: I7ae63a6e8799b42fed387562b91ebfb594956f44
Reviewed-on: http://codereview.qt-project.org/6245
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
This commit is contained in:
Kai Koehne
2011-10-07 15:00:05 +02:00
parent a7f17f8bdb
commit 9ca6cf4eb7
2 changed files with 10 additions and 1 deletions

View File

@@ -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);

View File

@@ -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;