X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fremotepeer.cpp;h=c3ad24f01717f1eb3ef68bfc13fae30061ba6c2a;hp=d621632fb736c8cf6f6e958edd5d3366dd5c64d8;hb=6eefdfc697067d184a589fc8a231b16316c09106;hpb=e2188dc438be6f3eb0d9cdf47d28821aefe9835e diff --git a/src/common/remotepeer.cpp b/src/common/remotepeer.cpp index d621632f..c3ad24f0 100644 --- a/src/common/remotepeer.cpp +++ b/src/common/remotepeer.cpp @@ -30,6 +30,7 @@ #endif #include "remotepeer.h" +#include "util.h" using namespace Protocol; @@ -46,20 +47,21 @@ RemotePeer::RemotePeer(::AuthHandler *authHandler, QTcpSocket *socket, Compresso _msgSize(0) { socket->setParent(this); - connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), SLOT(onSocketStateChanged(QAbstractSocket::SocketState))); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(onSocketError(QAbstractSocket::SocketError))); - connect(socket, SIGNAL(disconnected()), SIGNAL(disconnected())); + connect(socket, &QAbstractSocket::stateChanged, this, &RemotePeer::onSocketStateChanged); + connect(socket, selectOverload(&QAbstractSocket::error), this, &RemotePeer::onSocketError); + connect(socket, &QAbstractSocket::disconnected, this, &Peer::disconnected); #ifdef HAVE_SSL auto *sslSocket = qobject_cast(socket); - if (sslSocket) - connect(sslSocket, SIGNAL(encrypted()), SIGNAL(secureStateChanged())); + if (sslSocket) { + connect(sslSocket, &QSslSocket::encrypted, this, [this]() { emit secureStateChanged(true); }); + } #endif - connect(_compressor, SIGNAL(readyRead()), SLOT(onReadyRead())); - connect(_compressor, SIGNAL(error(Compressor::Error)), SLOT(onCompressionError(Compressor::Error))); + connect(_compressor, &Compressor::readyRead, this, &RemotePeer::onReadyRead); + connect(_compressor, &Compressor::error, this, &RemotePeer::onCompressionError); - connect(_heartBeatTimer, SIGNAL(timeout()), SLOT(sendHeartBeat())); + connect(_heartBeatTimer, &QTimer::timeout, this, &RemotePeer::sendHeartBeat); } @@ -132,7 +134,7 @@ void RemotePeer::setSignalProxy(::SignalProxy *proxy) return; } _signalProxy = proxy; - connect(proxy, SIGNAL(heartBeatIntervalChanged(int)), SLOT(changeHeartBeatInterval(int))); + connect(proxy, &SignalProxy::heartBeatIntervalChanged, this, &RemotePeer::changeHeartBeatInterval); _heartBeatTimer->setInterval(proxy->heartBeatInterval() * 1000); _heartBeatTimer->start(); }