From 13e89f96b86de7034af888617434f812a5303bdf Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Thu, 14 Aug 2014 22:35:03 +0400 Subject: Fix handling of writing at using of waitForReadyRead() The method waitForReadyRead() shall call of the write sequence since the signals from the startAsyncWriteTimer will not be handled inside of waitForReadyRead() without event-loop. Tested on Windows 8 with the on-board and USB serial ports, using Qt5. Task-number: QTBUG-40793 Change-Id: I7806f16a4df30c4ec1643d8f696ad5761decd30a Reviewed-by: Patrick Noffke Reviewed-by: Sergey Belyashov --- src/serialport/qserialport_win.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index 19f35b74..ecbf464a 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -327,6 +327,9 @@ bool QSerialPortPrivate::waitForReadyRead(int msecs) QElapsedTimer stopWatch; stopWatch.start(); + if (!writeStarted && !startAsyncWrite()) + return false; + const qint64 initialReadBufferSize = readBuffer.size(); qint64 currentReadBufferSize = initialReadBufferSize; -- cgit v1.2.3 From 286d64c202f461cb8ff5a4cc4c2320af8195b8f0 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sat, 16 Aug 2014 23:24:32 +0200 Subject: Add missing private headers warnings Change-Id: Ia60bf0d020d98a6fda8f689d631bb8681950d15f Reviewed-by: Sergey Belyashov --- src/serialport/qserialport_p.h | 11 +++++++++++ src/serialport/qserialport_symbian_p.h | 11 +++++++++++ src/serialport/qserialport_unix_p.h | 11 +++++++++++ src/serialport/qserialport_win_p.h | 11 +++++++++++ src/serialport/qserialport_wince_p.h | 11 +++++++++++ src/serialport/qserialportinfo_p.h | 11 +++++++++++ src/serialport/qtudev_p.h | 11 +++++++++++ 7 files changed, 77 insertions(+) diff --git a/src/serialport/qserialport_p.h b/src/serialport/qserialport_p.h index e969f2f2..364e050b 100644 --- a/src/serialport/qserialport_p.h +++ b/src/serialport/qserialport_p.h @@ -44,6 +44,17 @@ #ifndef QSERIALPORT_P_H #define QSERIALPORT_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qserialport.h" #include diff --git a/src/serialport/qserialport_symbian_p.h b/src/serialport/qserialport_symbian_p.h index 258a8111..e2cf1683 100644 --- a/src/serialport/qserialport_symbian_p.h +++ b/src/serialport/qserialport_symbian_p.h @@ -42,6 +42,17 @@ #ifndef QSERIALPORT_SYMBIAN_P_H #define QSERIALPORT_SYMBIAN_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qserialport_p.h" #include diff --git a/src/serialport/qserialport_unix_p.h b/src/serialport/qserialport_unix_p.h index ee3d82d5..1213c30a 100644 --- a/src/serialport/qserialport_unix_p.h +++ b/src/serialport/qserialport_unix_p.h @@ -43,6 +43,17 @@ #ifndef QSERIALPORT_UNIX_P_H #define QSERIALPORT_UNIX_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qserialport_p.h" #include diff --git a/src/serialport/qserialport_win_p.h b/src/serialport/qserialport_win_p.h index a997315b..f4297ef5 100644 --- a/src/serialport/qserialport_win_p.h +++ b/src/serialport/qserialport_win_p.h @@ -43,6 +43,17 @@ #ifndef QSERIALPORT_WIN_P_H #define QSERIALPORT_WIN_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qserialport_p.h" #include diff --git a/src/serialport/qserialport_wince_p.h b/src/serialport/qserialport_wince_p.h index 9697dc72..91bba3c7 100644 --- a/src/serialport/qserialport_wince_p.h +++ b/src/serialport/qserialport_wince_p.h @@ -43,6 +43,17 @@ #ifndef QSERIALPORT_WINCE_P_H #define QSERIALPORT_WINCE_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qserialport_p.h" #include diff --git a/src/serialport/qserialportinfo_p.h b/src/serialport/qserialportinfo_p.h index 47319410..1fb8a608 100644 --- a/src/serialport/qserialportinfo_p.h +++ b/src/serialport/qserialportinfo_p.h @@ -44,6 +44,17 @@ #ifndef QSERIALPORTINFO_P_H #define QSERIALPORTINFO_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include QT_BEGIN_NAMESPACE diff --git a/src/serialport/qtudev_p.h b/src/serialport/qtudev_p.h index 0f0246dc..09940abf 100644 --- a/src/serialport/qtudev_p.h +++ b/src/serialport/qtudev_p.h @@ -42,6 +42,17 @@ #ifndef QTUDEV_P_H #define QTUDEV_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #ifdef LINK_LIBUDEV extern "C" { -- cgit v1.2.3