summaryrefslogtreecommitdiffstats
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 12:33:29 +0000
commit319e735f518bafb7a83501e547cfc5a818894238 (patch)
treeb3ef6799f3db9be7df7d439256396fc087825090
parent1f4562574d8e99c5cd933bd0c867a05d629cdd05 (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>
-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 2923a08c..cd075cec 100644
--- a/src/bluetooth/qbluetoothsocket.cpp
+++ b/src/bluetooth/qbluetoothsocket.cpp
@@ -596,7 +596,7 @@ void QBluetoothSocket::setSocketState(QBluetoothSocket::SocketState state)
bool QBluetoothSocket::canReadLine() const
{
Q_D(const QBluetoothSocketBase);
- return d->canReadLine();
+ return d->canReadLine() || QIODevice::canReadLine();
}
/*!