X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientauthhandler.cpp;h=6661119fa41637dda84571f9751972ba74a7b776;hp=8fc2a7317ea12152b031dffe6ab05eb002a3d4ce;hb=b654b2f908590b6f69a7edadf9dacf1277a4493b;hpb=7920d1f52f65421496fa2ed41c2da8e3244b267b diff --git a/src/client/clientauthhandler.cpp b/src/client/clientauthhandler.cpp index 8fc2a731..6661119f 100644 --- a/src/client/clientauthhandler.cpp +++ b/src/client/clientauthhandler.cpp @@ -78,7 +78,7 @@ void ClientAuthHandler::connectToCore() setSocket(socket); // handled by the base class for now; may need to rethink for protocol detection //connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(onSocketError(QAbstractSocket::SocketError))); - //connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), SLOT(onSocketStateChanged(QAbstractSocket::SocketState))); + connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), SLOT(onSocketStateChanged(QAbstractSocket::SocketState))); connect(socket, SIGNAL(connected()), SLOT(onSocketConnected())); emit statusMessage(tr("Connecting to %1...").arg(_account.accountName())); @@ -87,45 +87,37 @@ void ClientAuthHandler::connectToCore() // TODO: handle protocol detection -// This method might go away anyway, unless we really need our own states... -/* void ClientAuthHandler::onSocketStateChanged(QAbstractSocket::SocketState socketState) { - qDebug() << Q_FUNC_INFO << socketState; QString text; - AuthHandler::State state = UnconnectedState; switch(socketState) { case QAbstractSocket::UnconnectedState: text = tr("Disconnected"); - state = UnconnectedState; + // 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; case QAbstractSocket::HostLookupState: text = tr("Looking up %1...").arg(_account.hostName()); - state = HostLookupState; break; case QAbstractSocket::ConnectingState: text = tr("Connecting to %1...").arg(_account.hostName()); - state = ConnectingState; break; case QAbstractSocket::ConnectedState: text = tr("Connected to %1").arg(_account.hostName()); - state = ConnectedState; break; case QAbstractSocket::ClosingState: text = tr("Disconnecting from %1...").arg(_account.hostName()); - state = ClosingState; break; default: break; } if (!text.isEmpty()) { - setState(state); emit statusMessage(text); } } -*/ // TODO: handle protocol detection /*