X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fremotepeer.cpp;h=d621632fb736c8cf6f6e958edd5d3366dd5c64d8;hp=e25cbb3f2c102f652b0d9d6de31bae4c9748d96c;hb=e2188dc438be6f3eb0d9cdf47d28821aefe9835e;hpb=53861faa5551606eea31588b65ba501b24fb2e1a diff --git a/src/common/remotepeer.cpp b/src/common/remotepeer.cpp index e25cbb3f..d621632f 100644 --- a/src/common/remotepeer.cpp +++ b/src/common/remotepeer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -39,7 +39,7 @@ RemotePeer::RemotePeer(::AuthHandler *authHandler, QTcpSocket *socket, Compresso : Peer(authHandler, parent), _socket(socket), _compressor(new Compressor(socket, level, this)), - _signalProxy(0), + _signalProxy(nullptr), _heartBeatTimer(new QTimer(this)), _heartBeatCount(0), _lag(0), @@ -51,7 +51,7 @@ RemotePeer::RemotePeer(::AuthHandler *authHandler, QTcpSocket *socket, Compresso connect(socket, SIGNAL(disconnected()), SIGNAL(disconnected())); #ifdef HAVE_SSL - QSslSocket *sslSocket = qobject_cast(socket); + auto *sslSocket = qobject_cast(socket); if (sslSocket) connect(sslSocket, SIGNAL(encrypted()), SIGNAL(secureStateChanged())); #endif @@ -121,8 +121,8 @@ void RemotePeer::setSignalProxy(::SignalProxy *proxy) if (!proxy) { _heartBeatTimer->stop(); - disconnect(signalProxy(), 0, this, 0); - _signalProxy = 0; + disconnect(signalProxy(), nullptr, this, nullptr); + _signalProxy = nullptr; if (isOpen()) close(); } @@ -168,7 +168,7 @@ bool RemotePeer::isSecure() const if (isLocal()) return true; #ifdef HAVE_SSL - QSslSocket *sslSocket = qobject_cast(socket()); + auto *sslSocket = qobject_cast(socket()); if (sslSocket && sslSocket->isEncrypted()) return true; #endif @@ -214,7 +214,6 @@ void RemotePeer::onReadyRead() processMessage(msg); - if (SignalProxy::current()) SignalProxy::current()->setSourcePeer(nullptr); } @@ -261,7 +260,7 @@ bool RemotePeer::readMessage(QByteArray &msg) void RemotePeer::writeMessage(const QByteArray &msg) { - quint32 size = qToBigEndian(msg.size()); + auto size = qToBigEndian(msg.size()); _compressor->write((const char*)&size, 4, Compressor::NoFlush); _compressor->write(msg.constData(), msg.size()); }