forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user