- switch(socketState) {
- case QAbstractSocket::HostLookupState:
- if (!_legacy)
- text = tr("Looking up %1...").arg(_account.hostName());
- break;
- case QAbstractSocket::ConnectingState:
- if (!_legacy)
- text = tr("Connecting to %1...").arg(_account.hostName());
- break;
- case QAbstractSocket::ConnectedState:
- text = tr("Connected to %1").arg(_account.hostName());
- break;
- case QAbstractSocket::ClosingState:
- if (!_probing)
- text = tr("Disconnecting from %1...").arg(_account.hostName());
- break;
- case QAbstractSocket::UnconnectedState:
- if (!_probing) {
- text = tr("Disconnected");
- // Ensure the disconnected() signal is sent even if we haven't reached the Connected state yet.
- // The baseclass implementation will make sure to only send the signal once.
- onSocketDisconnected();
- }
- break;
- default:
- break;
+ switch (socketState) {
+ case QAbstractSocket::HostLookupState:
+ if (!_legacy)
+ text = tr("Looking up %1...").arg(_account.hostName());
+ break;
+ case QAbstractSocket::ConnectingState:
+ if (!_legacy)
+ text = tr("Connecting to %1...").arg(_account.hostName());
+ break;
+ case QAbstractSocket::ConnectedState:
+ text = tr("Connected to %1").arg(_account.hostName());
+ break;
+ case QAbstractSocket::ClosingState:
+ if (!_probing)
+ text = tr("Disconnecting from %1...").arg(_account.hostName());
+ break;
+ case QAbstractSocket::UnconnectedState:
+ if (!_probing) {
+ text = tr("Disconnected");
+ // Ensure the disconnected() signal is sent even if we haven't reached the Connected state yet.
+ // The baseclass implementation will make sure to only send the signal once.
+ // However, we do want to prefer a potential socket error signal that may be on route already, so
+ // give this a chance to overtake us by spinning the loop...
+ QTimer::singleShot(0, this, &ClientAuthHandler::onSocketDisconnected);
+ }
+ break;
+ default:
+ break;