diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-18 03:01:30 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-18 03:01:30 +0200 |
commit | 882ae7c5964d412d2cbf2e19f54a75b76a0bc328 (patch) | |
tree | 36b0dd6dab7923ca3c91891a212597f497a65e11 | |
parent | f8f3555c934bb541c307792a6ce1399498a810a5 (diff) | |
parent | 4bfbdd3d061e88de147102db94e70283b89ffff5 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I113af3e297c1f8eb0c8ff337e60f5fadf08db631
-rw-r--r-- | dist/changes-5.11.2 | 24 | ||||
-rw-r--r-- | src/serialbus/doc/src/qtserialbus-module-cpp.qdoc | 4 | ||||
-rw-r--r-- | src/serialbus/qcanbusdevice.cpp | 6 | ||||
-rw-r--r-- | src/serialbus/qcanbusdevice.h | 2 | ||||
-rw-r--r-- | tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp | 18 |
5 files changed, 39 insertions, 15 deletions
diff --git a/dist/changes-5.11.2 b/dist/changes-5.11.2 new file mode 100644 index 0000000..8efdf5e --- /dev/null +++ b/dist/changes-5.11.2 @@ -0,0 +1,24 @@ +Qt 5.11.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.11.0 through 5.11.1. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.11 series is binary compatible with the 5.10.x series. +Applications compiled for 5.10 will continue to run with 5.11. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.11.2 Changes * +**************************************************************************** + + - This release contains only minor code improvements. diff --git a/src/serialbus/doc/src/qtserialbus-module-cpp.qdoc b/src/serialbus/doc/src/qtserialbus-module-cpp.qdoc index 6280f6f..74123fc 100644 --- a/src/serialbus/doc/src/qtserialbus-module-cpp.qdoc +++ b/src/serialbus/doc/src/qtserialbus-module-cpp.qdoc @@ -40,7 +40,9 @@ For C++ projects include the header appropriate for the current use case, for example applications using the CAN bus device may use - \code #include <QCanBusDevice> \endcode + \code + #include <QCanBusDevice> + \endcode The .pro file should have the \e serialbus keyword added diff --git a/src/serialbus/qcanbusdevice.cpp b/src/serialbus/qcanbusdevice.cpp index 4484225..6dc8abd 100644 --- a/src/serialbus/qcanbusdevice.cpp +++ b/src/serialbus/qcanbusdevice.cpp @@ -450,12 +450,12 @@ qint64 QCanBusDevice::framesToWrite() const \sa framesAvailable(), readFrame(), framesToWrite(), writeFrame(), */ -bool QCanBusDevice::clear(QCanBusDevice::Directions direction) +void QCanBusDevice::clear(QCanBusDevice::Directions direction) { Q_D(QCanBusDevice); if (Q_UNLIKELY(d->state != ConnectedState)) - return false; + return; if (direction & Direction::Input) { QMutexLocker(&d->incomingFramesGuard); @@ -464,8 +464,6 @@ bool QCanBusDevice::clear(QCanBusDevice::Directions direction) if (direction & Direction::Output) d->outgoingFrames.clear(); - - return true; } /*! diff --git a/src/serialbus/qcanbusdevice.h b/src/serialbus/qcanbusdevice.h index 5d99e6a..a47fac4 100644 --- a/src/serialbus/qcanbusdevice.h +++ b/src/serialbus/qcanbusdevice.h @@ -115,7 +115,7 @@ public: AllDirections = Input | Output }; Q_DECLARE_FLAGS(Directions, Direction) - bool clear(Directions direction = Direction::AllDirections); + void clear(Directions direction = Direction::AllDirections); virtual bool waitForFramesWritten(int msecs); virtual bool waitForFramesReceived(int msecs); diff --git a/tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp b/tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp index 389e013..85d445f 100644 --- a/tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp +++ b/tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp @@ -291,16 +291,15 @@ void tst_QCanBusDevice::readAll() void tst_QCanBusDevice::clearInputBuffer() { - device->disconnectDevice(); - QVERIFY(!device->clear(QCanBusDevice::Input)); - - QVERIFY(device->connectDevice()); - QTRY_VERIFY_WITH_TIMEOUT(device->state() == QCanBusDevice::ConnectedState, 5000); + if (device->state() != QCanBusDevice::ConnectedState) { + QVERIFY(device->connectDevice()); + QTRY_VERIFY_WITH_TIMEOUT(device->state() == QCanBusDevice::ConnectedState, 5000); + } for (int i = 0; i < 10; ++i) device->triggerNewFrame(); - QVERIFY(device->clear(QCanBusDevice::Input)); + device->clear(QCanBusDevice::Input); QVERIFY(!device->framesAvailable()); } @@ -309,10 +308,11 @@ void tst_QCanBusDevice::clearOutputBuffer() { // this test requires buffered writing device->setWriteBuffered(true); - device->disconnectDevice(); - QVERIFY(!device->clear(QCanBusDevice::Output)); - QVERIFY(device->connectDevice()); + if (device->state() != QCanBusDevice::ConnectedState) { + QVERIFY(device->connectDevice()); + QTRY_VERIFY_WITH_TIMEOUT(device->state() == QCanBusDevice::ConnectedState, 5000); + } // first test buffered writing, frames will be written after some delay QSignalSpy spy(device.data(), &QCanBusDevice::framesWritten); |