+ _autoReconnectTimer.setSingleShot(true);
+ _previousConnectionAttemptFailed = false;
+ _lastUsedServerlistIndex = 0;
+ // TODO make configurable
+ _whoTimer.setInterval(60 * 1000);
+ _whoTimer.setSingleShot(false);
+
+ QHash<QString, QString> channels = coreSession()->persistentChannels(networkId());
+ foreach(QString chan, channels.keys()) {
+ _channelKeys[chan.toLower()] = channels[chan];
+ }
+
+ connect(&_autoReconnectTimer, SIGNAL(timeout()), this, SLOT(doAutoReconnect()));
+ connect(&_whoTimer, SIGNAL(timeout()), this, SLOT(sendWho()));
+
+ connect(network, SIGNAL(currentServerSet(const QString &)), this, SLOT(networkInitialized(const QString &)));
+ connect(network, SIGNAL(useAutoReconnectSet(bool)), this, SLOT(autoReconnectSettingsChanged()));
+ connect(network, SIGNAL(autoReconnectIntervalSet(quint32)), this, SLOT(autoReconnectSettingsChanged()));
+ connect(network, SIGNAL(autoReconnectRetriesSet(quint16)), this, SLOT(autoReconnectSettingsChanged()));
+
+#ifndef QT_NO_OPENSSL
+ connect(&socket, SIGNAL(encrypted()), this, SLOT(socketEncrypted()));
+ connect(&socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
+#endif
+ connect(&socket, SIGNAL(connected()), this, SLOT(socketConnected()));
+
+ connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
+ connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError)));
+ connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
+ connect(&socket, SIGNAL(readyRead()), this, SLOT(socketHasData()));
+
+ connect(_ircServerHandler, SIGNAL(nickChanged(const QString &, const QString &)),
+ this, SLOT(nickChanged(const QString &, const QString &)));
+
+ network->proxy()->attachSignal(this, SIGNAL(sslErrors(const QVariant &)));