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-20 08:07:49 +0000 |
commit | 918b22aef140d293721f0d81ea8988c1d35db582 (patch) | |
tree | 65952c54daf6d85448150122788233ef4eda1cc9 /src/serialport/qserialport.cpp | |
parent | 55f39fe09aaf6208fd27c3c6060d4ab0171f77b1 (diff) | |
download | qtserialport-918b22aef140d293721f0d81ea8988c1d35db582.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.
Change-Id: Ib0c5d1396819aabe459002c5ca5cca5840052eff
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/serialport/qserialport.cpp')
-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 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 |