QAbstractSocket::canReadLine(): remove code duplication
authorAlex Trotsenko <alex1973tr@gmail.com>
Wed, 15 Jul 2015 15:11:38 +0000 (18:11 +0300)
committerAlex Trotsenko <alex1973tr@gmail.com>
Thu, 13 Aug 2015 17:08:28 +0000 (17:08 +0000)
Contents of the QIODevice's buffer is handled in the base
implementation.

Change-Id: I5a3d68e4e8dcb16d7f5ad695ac43127b8047a061
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/network/socket/qabstractsocket.cpp
src/network/socket/qabstractsocket.h

index 35b541d739bcc00aa911c5c7e87d6f905f53f806..371b9e02645cd5d152d7325c262c0330015fb7ed 100644 (file)
@@ -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;
 }
 
 /*!
index b433c7e97fe070499dadb99b507257b761d06904..23f0d26cbdc13f5cc5673378e44508669e787121 100644 (file)
@@ -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;