From 918b22aef140d293721f0d81ea8988c1d35db582 Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Thu, 10 Sep 2015 12:30:09 +0300 Subject: Allow to use the QSP::IgnorePolicy only It is impossible to fix the dataErrorPolicy property that it worked at any platforms (this property does not work at all), besides, this property was deprecated. Therefore we can use always only the IgnorePolicy value for all cases, that will not be worse than it is. It gives a chance to get rid of internal code, related to dataErrorPolicy handling in favor to fixing of the Mark/Space parity handling, and the Parity/Frame/BreackCondition errors handling. Change-Id: Ib0c5d1396819aabe459002c5ca5cca5840052eff Reviewed-by: Sergey Belyashov Reviewed-by: Denis Shienkov --- src/serialport/qserialport.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index 54a3f47..071e33d 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -1136,13 +1136,13 @@ bool QSerialPort::setDataErrorPolicy(DataErrorPolicy policy) return false; } - const bool ret = d->policy == policy || d->setDataErrorPolicy(policy); - if (ret && (d->policy != policy)) { - d->policy = policy; - emit dataErrorPolicyChanged(d->policy); + if (policy != QSerialPort::IgnorePolicy) { + d->setError(QSerialPortErrorInfo(QSerialPort::UnsupportedOperationError, + tr("The device supports only the ignoring policy"))); + return false; } - return ret; + return true; } QSerialPort::DataErrorPolicy QSerialPort::dataErrorPolicy() const -- cgit v1.2.1