summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-16 15:29:27 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-16 15:29:27 +0200
commitef8ed357881b212e2debe2ccf975996bca2331c2 (patch)
tree67cb9ee9821bd1fb9b9813b038ffbc06a7847ddd /src
parentb111a3a6fb4b6c2892fe3b1c9cdf72d8e8f9ea8d (diff)
parentf1761c1236edce428278f7a9e8aa1091097eaa57 (diff)
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts: .qmake.conf Change-Id: I5887622f233275703cca8cc2a5db4aaaccc72d97
Diffstat (limited to 'src')
-rw-r--r--src/serialport/qserialport.cpp9
-rw-r--r--src/serialport/qserialport.h3
-rw-r--r--src/serialport/qserialport_win.cpp19
-rw-r--r--src/serialport/qserialport_win_p.h2
4 files changed, 19 insertions, 14 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp
index 2e1bac54..297bf623 100644
--- a/src/serialport/qserialport.cpp
+++ b/src/serialport/qserialport.cpp
@@ -71,7 +71,9 @@ QSerialPortPrivateData::QSerialPortPrivateData(QSerialPort *q)
, policy(QSerialPort::IgnorePolicy)
, dataTerminalReady(false)
, requestToSend(false)
+#if QT_DEPRECATED_SINCE(5,3)
, settingsRestoredOnClose(true)
+#endif
, q_ptr(q)
{
}
@@ -572,6 +574,7 @@ void QSerialPort::close()
The default state of the QSerialPort class is to restore the
settings.
*/
+#if QT_DEPRECATED_SINCE(5,3)
void QSerialPort::setSettingsRestoredOnClose(bool restore)
{
Q_D(QSerialPort);
@@ -587,9 +590,10 @@ bool QSerialPort::settingsRestoredOnClose() const
Q_D(const QSerialPort);
return d->settingsRestoredOnClose;
}
-
+#endif // QT_DEPRECATED_SINCE(5,3)
/*!
\fn void QSerialPort::settingsRestoredOnCloseChanged(bool restore)
+ \obsolete
This signal is emitted after the flag which specifies to restore the
previous settings while closing the serial port has been changed. The new
@@ -1069,6 +1073,7 @@ bool QSerialPort::atEnd() const
with the kernel and hardware. Hence, the two scenarios cannot be completely
compared to each other.
*/
+#if QT_DEPRECATED_SINCE(5, 2)
bool QSerialPort::setDataErrorPolicy(DataErrorPolicy policy)
{
Q_D(QSerialPort);
@@ -1093,7 +1098,7 @@ QSerialPort::DataErrorPolicy QSerialPort::dataErrorPolicy() const
Q_D(const QSerialPort);
return d->policy;
}
-
+#endif // QT_DEPRECATED_SINCE(5, 2)
/*!
\fn void QSerialPort::dataErrorPolicyChanged(DataErrorPolicy policy)
\obsolete
diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h
index f114fd42..a8f9a05a 100644
--- a/src/serialport/qserialport.h
+++ b/src/serialport/qserialport.h
@@ -255,9 +255,7 @@ Q_SIGNALS:
void parityChanged(QSerialPort::Parity parity);
void stopBitsChanged(QSerialPort::StopBits stopBits);
void flowControlChanged(QSerialPort::FlowControl flowControl);
-#if QT_DEPRECATED_SINCE(5, 2)
void dataErrorPolicyChanged(QSerialPort::DataErrorPolicy policy);
-#endif
void dataTerminalReadyChanged(bool set);
void requestToSendChanged(bool set);
void error(QSerialPort::SerialPortError serialPortError);
@@ -279,6 +277,7 @@ private:
Q_PRIVATE_SLOT(d_func(), bool _q_completeAsyncCommunication())
Q_PRIVATE_SLOT(d_func(), bool _q_completeAsyncRead())
Q_PRIVATE_SLOT(d_func(), bool _q_completeAsyncWrite())
+ Q_PRIVATE_SLOT(d_func(), bool _q_startAsyncWrite())
#endif
};
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp
index 9daa728f..32b8d0a1 100644
--- a/src/serialport/qserialport_win.cpp
+++ b/src/serialport/qserialport_win.cpp
@@ -251,7 +251,7 @@ bool QSerialPortPrivate::setRequestToSend(bool set)
bool QSerialPortPrivate::flush()
{
- return startAsyncWrite();
+ return _q_startAsyncWrite();
}
bool QSerialPortPrivate::clear(QSerialPort::Directions directions)
@@ -305,7 +305,7 @@ void QSerialPortPrivate::startWriting()
if (!writeStarted) {
if (!startAsyncWriteTimer) {
startAsyncWriteTimer = new QTimer(q);
- q->connect(startAsyncWriteTimer, SIGNAL(timeout()), q, SLOT(_q_completeAsyncWrite()));
+ q->connect(startAsyncWriteTimer, SIGNAL(timeout()), q, SLOT(_q_startAsyncWrite()));
startAsyncWriteTimer->setSingleShot(true);
}
startAsyncWriteTimer->start(0);
@@ -319,7 +319,7 @@ bool QSerialPortPrivate::waitForReadyRead(int msecs)
QElapsedTimer stopWatch;
stopWatch.start();
- if (!writeStarted && !startAsyncWrite())
+ if (!writeStarted && !_q_startAsyncWrite())
return false;
const qint64 initialReadBufferSize = readBuffer.size();
@@ -373,7 +373,7 @@ bool QSerialPortPrivate::waitForBytesWritten(int msecs)
QElapsedTimer stopWatch;
stopWatch.start();
- if (!writeStarted && !startAsyncWrite())
+ if (!writeStarted && !_q_startAsyncWrite())
return false;
forever {
@@ -535,17 +535,18 @@ bool QSerialPortPrivate::_q_completeAsyncWrite()
Q_Q(QSerialPort);
if (writeStarted) {
- writeStarted = false;
const qint64 bytesTransferred = handleOverlappedResult(QSerialPort::Output, writeCompletionOverlapped);
- if (bytesTransferred == qint64(-1))
+ if (bytesTransferred == qint64(-1)) {
+ writeStarted = false;
return false;
- if (bytesTransferred > 0) {
+ } else if (bytesTransferred > 0) {
writeBuffer.free(bytesTransferred);
emit q->bytesWritten(bytesTransferred);
}
+ writeStarted = false;
}
- return startAsyncWrite();
+ return _q_startAsyncWrite();
}
bool QSerialPortPrivate::startAsyncCommunication()
@@ -597,7 +598,7 @@ bool QSerialPortPrivate::startAsyncRead()
return true;
}
-bool QSerialPortPrivate::startAsyncWrite()
+bool QSerialPortPrivate::_q_startAsyncWrite()
{
Q_Q(QSerialPort);
diff --git a/src/serialport/qserialport_win_p.h b/src/serialport/qserialport_win_p.h
index 7ec7a2ee..93f8591e 100644
--- a/src/serialport/qserialport_win_p.h
+++ b/src/serialport/qserialport_win_p.h
@@ -100,7 +100,7 @@ public:
bool startAsyncCommunication();
bool startAsyncRead();
- bool startAsyncWrite();
+ bool _q_startAsyncWrite();
bool emulateErrorPolicy();
void emitReadyRead();