_inflater(nullptr),
_deflater(nullptr)
{
- connect(socket, SIGNAL(readyRead()), SLOT(readData()));
+ connect(socket, &QIODevice::readyRead, this, &Compressor::readData);
bool ok = true;
if (level != NoCompression)
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);
}
// 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;
}