[PATCH 1/2] qtserialbluetooth: Remove no-op calls

Anton Lundin glance at acc.umu.se
Tue Sep 29 12:12:54 PDT 2015


waitForReadyRead and waitForBytesWritten not overridden in
QBluetoothSocket and the default implementation in QIODevice are just
no-ops that always return false.

This removes those calls to lessen the confusion for anyone who looks at
the code.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
I'm CC'ing Thiago and Claudiu here, so they can take a look and stop me
if I've gone off by meds and misunderstood something here.

So, Dirk: Please wait for a comment from them before taking these patches.

 qtserialbluetooth.cpp | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/qtserialbluetooth.cpp b/qtserialbluetooth.cpp
index 6f93d8c..6a3360c 100644
--- a/qtserialbluetooth.cpp
+++ b/qtserialbluetooth.cpp
@@ -236,8 +236,6 @@ static int qt_serial_read(serial_t *device, void* data, unsigned int size)
 
 	while(nbytes < size && device->socket->state() == QBluetoothSocket::ConnectedState)
 	{
-		device->socket->waitForReadyRead(device->timeout);
-
 		rc = device->socket->read((char *) data + nbytes, size - nbytes);
 
 		if (rc < 0) {
@@ -295,8 +293,6 @@ static int qt_serial_write(serial_t *device, const void* data, unsigned int size
 
 	while(nbytes < size && device->socket->state() == QBluetoothSocket::ConnectedState)
 	{
-		device->socket->waitForBytesWritten(device->timeout);
-
 		rc = device->socket->write((char *) data + nbytes, size - nbytes);
 
 		if (rc < 0) {
-- 
2.1.4



More information about the subsurface mailing list