OAuth: fix compilation with old gcc
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 28 Sep 2017 08:54:27 +0000 (10:54 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 5 Oct 2017 20:01:38 +0000 (22:01 +0200)
We need to used QPointer::data in the signal slot connection

Relates to pr #6065

src/gui/creds/oauth.cpp

index f06fe3a3cd940bc9368e41cde3a16818f968ff16..85a13f4c1bb8c747c7deffb2ac41ca37fe43cf29 100644 (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