QML Debugger: Show error messages when connection is lost

Related to Qt commit bd521ed56f8e4be7117dc3534c6fded68f7a70c5
This commit is contained in:
Lasse Holmstedt
2010-08-27 13:11:55 +02:00
parent 1f1dcfdec1
commit 31c8b444db
4 changed files with 12 additions and 9 deletions

View File

@@ -99,7 +99,7 @@ bool QmlAdapter::connectToViewer()
connect(m_conn, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
SLOT(connectionStateChanged()));
connect(m_conn, SIGNAL(error(QAbstractSocket::SocketError)),
SLOT(connectionErrorOccurred()));
SLOT(connectionErrorOccurred(QAbstractSocket::SocketError)));
QString address = m_engine.data()->startParameters().qmlServerAddress;
QString port = QString::number(m_engine.data()->startParameters().qmlServerPort);
@@ -114,14 +114,14 @@ bool QmlAdapter::connectToViewer()
return true;
}
void QmlAdapter::connectionErrorOccurred()
void QmlAdapter::connectionErrorOccurred(QAbstractSocket::SocketError socketError)
{
showConnectionErrorMessage(tr("Error: (%1) %2", "%1=error code, %2=error message")
.arg(m_conn->error()).arg(m_conn->errorString()));
// this is only an error if we are already connected and something goes wrong.
if (isConnected())
emit connectionError();
emit connectionError(socketError);
}
void QmlAdapter::connectionStateChanged()