From 6fca88607b0300cf4ddd81af924d7ef25abd7bd1 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Wed, 15 Jul 2015 18:11:38 +0300 Subject: [PATCH] QAbstractSocket::canReadLine(): remove code duplication Contents of the QIODevice's buffer is handled in the base implementation. Change-Id: I5a3d68e4e8dcb16d7f5ad695ac43127b8047a061 Reviewed-by: Thiago Macieira --- src/network/socket/qabstractsocket.cpp | 4 ++-- src/network/socket/qabstractsocket.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 35b541d739b..371b9e02645 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1810,12 +1810,12 @@ QString QAbstractSocket::peerName() const */ bool QAbstractSocket::canReadLine() const { - bool hasLine = d_func()->buffer.canReadLine(); + bool hasLine = QIODevice::canReadLine(); #if defined (QABSTRACTSOCKET_DEBUG) qDebug("QAbstractSocket::canReadLine() == %s, buffer size = %lld, size = %lld", hasLine ? "true" : "false", d_func()->buffer.size(), d_func()->buffer.size()); #endif - return hasLine || QIODevice::canReadLine(); + return hasLine; } /*! diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h index b433c7e97fe..23f0d26cbdc 100644 --- a/src/network/socket/qabstractsocket.h +++ b/src/network/socket/qabstractsocket.h @@ -149,7 +149,7 @@ public: qint64 bytesAvailable() const Q_DECL_OVERRIDE; qint64 bytesToWrite() const Q_DECL_OVERRIDE; - bool canReadLine() const Q_DECL_OVERRIDE; + bool canReadLine() const Q_DECL_OVERRIDE; // ### Qt6: remove me quint16 localPort() const; QHostAddress localAddress() const;