X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fcompressor.cpp;h=816f26c8519784b3ea147acf5fd11ef360753473;hb=8f2ee00f4edef1693628d3af0bdee84d725eb754;hp=84b8f7fead4112d3153e46a6171b5204563a0917;hpb=6718d7a1ccd42d7aae75e57d6974e0b1e0384044;p=quassel.git diff --git a/src/common/compressor.cpp b/src/common/compressor.cpp index 84b8f7fe..816f26c8 100644 --- a/src/common/compressor.cpp +++ b/src/common/compressor.cpp @@ -30,10 +30,10 @@ Compressor::Compressor(QTcpSocket *socket, Compressor::CompressionLevel level, Q : QObject(parent), _socket(socket), _level(level), - _inflater(0), - _deflater(0) + _inflater(nullptr), + _deflater(nullptr) { - connect(socket, SIGNAL(readyRead()), SLOT(readData())); + connect(socket, &QIODevice::readyRead, this, &Compressor::readData); bool ok = true; if (level != NoCompression) @@ -41,14 +41,14 @@ Compressor::Compressor(QTcpSocket *socket, Compressor::CompressionLevel level, Q if (!ok) { // something went wrong during initialization... but we can only emit an error after RemotePeer has connected its signal - QTimer::singleShot(0, this, SIGNAL(error())); + QTimer::singleShot(0, this, [this]() { emit error(); }); return; } // It's possible that more data has already arrived during the handshake, so readyRead() wouldn't be triggered. // However, we want to give RemotePeer a chance to connect to our signals, so trigger this asynchronously. if (socket->bytesAvailable()) - QTimer::singleShot(0, this, SLOT(readData())); + QTimer::singleShot(0, this, &Compressor::readData); } @@ -126,7 +126,7 @@ qint64 Compressor::read(char *data, qint64 maxSize) // If there's still data left in the socket buffer, make sure to schedule a read if (_socket->bytesAvailable()) - QTimer::singleShot(0, this, SLOT(readData())); + QTimer::singleShot(0, this, &Compressor::readData); return n; }