QAbstractSocket::canReadLine(): remove code duplication

Contents of the QIODevice's buffer is handled in the base
implementation.

Change-Id: I5a3d68e4e8dcb16d7f5ad695ac43127b8047a061
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Alex Trotsenko 2015-07-15 18:11:38 +03:00
parent 194403a348
commit 6fca88607b
2 changed files with 3 additions and 3 deletions

View File

@ -1810,12 +1810,12 @@ QString QAbstractSocket::peerName() const
*/ */
bool QAbstractSocket::canReadLine() const bool QAbstractSocket::canReadLine() const
{ {
bool hasLine = d_func()->buffer.canReadLine(); bool hasLine = QIODevice::canReadLine();
#if defined (QABSTRACTSOCKET_DEBUG) #if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocket::canReadLine() == %s, buffer size = %lld, size = %lld", qDebug("QAbstractSocket::canReadLine() == %s, buffer size = %lld, size = %lld",
hasLine ? "true" : "false", d_func()->buffer.size(), d_func()->buffer.size()); hasLine ? "true" : "false", d_func()->buffer.size(), d_func()->buffer.size());
#endif #endif
return hasLine || QIODevice::canReadLine(); return hasLine;
} }
/*! /*!

View File

@ -149,7 +149,7 @@ public:
qint64 bytesAvailable() const Q_DECL_OVERRIDE; qint64 bytesAvailable() const Q_DECL_OVERRIDE;
qint64 bytesToWrite() 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; quint16 localPort() const;
QHostAddress localAddress() const; QHostAddress localAddress() const;