summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2022-03-14 13:03:27 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-17 13:18:17 +0000
commit2b3b5c899ebdb0fc11273af7370804f5f03ad9e8 (patch)
treea11d5ec9990268a097b879e79636a913cab7614c /src
parent70ed6f2df679fde389a8953841b5807ba21ba52c (diff)
Add QIODevice::canReadLine call to QBluetoothSocket
At least on Linux the QIODevice parent class reads and buffers a large chunk of data when readLine() is called. This call effectively empties the private linear data buffer, and subsequent canReadLine() calls to the private buffer returns false. This is problematic if the data contained several lines of data; the QBluetoothSocket::canReadLine() returns false but readLine() returns valid lines of data. This commit adds a parent class call so that it's buffers are also taken into account as per QIODevice documentation. Fixes: QTBUG-101690 Change-Id: I8130aff217e9e6c5525101901ed55721430b6dd0 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 393fd47ab64ce80fb0e852027591840aef8e135d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth/qbluetoothsocket.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp
index 411d6213..864b9cab 100644
--- a/src/bluetooth/qbluetoothsocket.cpp
+++ b/src/bluetooth/qbluetoothsocket.cpp
@@ -598,7 +598,7 @@ void QBluetoothSocket::setSocketState(QBluetoothSocket::SocketState state)
bool QBluetoothSocket::canReadLine() const
{
Q_D(const QBluetoothSocketBase);
- return d->canReadLine();
+ return d->canReadLine() || QIODevice::canReadLine();
}
/*!