OAuth: fix compilation with old gcc

We need to used QPointer::data in the signal slot connection

Relates to pr #6065
This commit is contained in:
Olivier Goffart 2017-09-28 10:54:27 +02:00 committed by Roeland Jago Douma
parent 78078b714e
commit c424dec7d4
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -65,8 +65,8 @@ void OAuth::start()
QObject::connect(&_server, &QTcpServer::newConnection, this, [this] {
while (QPointer<QTcpSocket> socket = _server.nextPendingConnection()) {
QObject::connect(socket, &QTcpSocket::disconnected, socket, &QTcpSocket::deleteLater);
QObject::connect(socket, &QIODevice::readyRead, this, [this, socket] {
QObject::connect(socket.data(), &QTcpSocket::disconnected, socket.data(), &QTcpSocket::deleteLater);
QObject::connect(socket.data(), &QIODevice::readyRead, this, [this, socket] {
QByteArray peek = socket->peek(qMin(socket->bytesAvailable(), 4000LL)); //The code should always be within the first 4K
if (peek.indexOf('\n') < 0)
return; // wait until we find a \n