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

@@ -166,9 +166,10 @@ void QmlEngine::connectionStartupFailed()
notifyEngineRunFailed();
}
void QmlEngine::connectionError()
void QmlEngine::connectionError(QAbstractSocket::SocketError socketError)
{
// do nothing for now - only exit the debugger when inferior exits.
if (socketError ==QAbstractSocket::RemoteHostClosedError)
plugin()->showMessage(tr("QML Debugger: Remote host closed connection."), StatusBar);
}
void QmlEngine::runEngine()
@@ -251,13 +252,15 @@ void QmlEngine::shutdownEngine()
shutdownEngineAsSlave();
notifyEngineShutdownOk();
plugin()->showMessage(QString(), StatusBar);
}
void QmlEngine::setupEngine()
{
m_adapter->setMaxConnectionAttempts(MaxConnectionAttempts);
m_adapter->setConnectionAttemptInterval(ConnectionAttemptDefaultInterval);
connect(m_adapter, SIGNAL(connectionError()), SLOT(connectionError()));
connect(m_adapter, SIGNAL(connectionError(QAbstractSocket::SocketError)),
SLOT(connectionError(QAbstractSocket::SocketError)));
connect(m_adapter, SIGNAL(connected()), SLOT(connectionEstablished()));
connect(m_adapter, SIGNAL(connectionStartupFailed()), SLOT(connectionStartupFailed()));