summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2016-01-20 20:10:48 +0200
committerAlex Trotsenko <alex1973tr@gmail.com>2016-01-21 06:42:54 +0000
commitf9169594ce8e80fd12994ea7718a040a24a896d4 (patch)
treec3bb4fa92cbb574076a76f33272d917b7e9c822f
parent11b732cfdad2513a761e7d045dca8431df40d16b (diff)
downloadqtserialport-f9169594ce8e80fd12994ea7718a040a24a896d4.tar.gz
QSerialPort::atEnd(): remove code duplication
These conditions are checked in the base implementation. Change-Id: I4bb010d48c6a581a140ba697f9dc31390d2067d2 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r--src/serialport/qserialport.cpp3
-rw-r--r--src/serialport/qserialport.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp
index 6832883..c64fba6 100644
--- a/src/serialport/qserialport.cpp
+++ b/src/serialport/qserialport.cpp
@@ -1088,8 +1088,7 @@ bool QSerialPort::clear(Directions directions)
*/
bool QSerialPort::atEnd() const
{
- Q_D(const QSerialPort);
- return QIODevice::atEnd() && (!isOpen() || (d->buffer.size() == 0));
+ return QIODevice::atEnd();
}
#if QT_DEPRECATED_SINCE(5, 2)
diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h
index a19e1bf..af37f16 100644
--- a/src/serialport/qserialport.h
+++ b/src/serialport/qserialport.h
@@ -237,7 +237,7 @@ public:
bool flush();
bool clear(Directions directions = AllDirections);
- bool atEnd() const Q_DECL_OVERRIDE;
+ bool atEnd() const Q_DECL_OVERRIDE; // ### Qt6: remove me
#if QT_DEPRECATED_SINCE(5, 2)
QT_DEPRECATED bool setDataErrorPolicy(DataErrorPolicy policy = IgnorePolicy);