diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2015-09-10 12:30:09 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2015-09-24 15:53:08 +0000 |
commit | 5c0fed7b7c19641e0dcc7740277ac5f54422b4bf (patch) | |
tree | 12f0fac9dc0aa6fae903f462fc1c1f195fc87e72 | |
parent | 1b474243ed2b23a4f7ecd57b339b01feac020179 (diff) | |
download | qtserialport-5c0fed7b7c19641e0dcc7740277ac5f54422b4bf.tar.gz |
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.
(cherry-picked from 918b22aef140d293721f0d81ea8988c1d35db582)
Change-Id: Ib0c5d1396819aabe459002c5ca5cca5840052eff
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r-- | src/serialport/qserialport.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index a8ecfbd..0973d45 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -1130,13 +1130,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 |