summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLaszlo Papp <lpapp@kde.org>2013-11-20 18:31:30 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-21 04:53:29 +0100
commitc43d57ef196c688d4378582bfb42db1d4ff3389f (patch)
treef704d744b1eea198f32eebac7e06e01ed8547341 /examples
parentf1e51c6842bb17eb3b061b637669ee5fe1459e73 (diff)
downloadqtserialport-c43d57ef196c688d4378582bfb42db1d4ff3389f.tar.gz
Do not handle "no data available" as error in the timeout handler
Change-Id: I132a668f1eca2d7a1ac353b6e088b7b07d4e2e12 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/serialport/creaderasync/serialportreader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/serialport/creaderasync/serialportreader.cpp b/examples/serialport/creaderasync/serialportreader.cpp
index 5dd7412..e238304 100644
--- a/examples/serialport/creaderasync/serialportreader.cpp
+++ b/examples/serialport/creaderasync/serialportreader.cpp
@@ -72,13 +72,13 @@ void SerialPortReader::handleReadyRead()
void SerialPortReader::handleTimeout()
{
if (m_readData.isEmpty()) {
- m_standardOutput << QObject::tr("Either no data was currently available for reading, or an error occurred for port %1, error: %2").arg(m_serialPort->portName()).arg(m_serialPort->errorString()) << endl;
- QCoreApplication::exit(1);
+ m_standardOutput << QObject::tr("No data was currently available for reading from port %1").arg(m_serialPort->portName()) << endl;
} else {
m_standardOutput << QObject::tr("Data successfully received from port %1").arg(m_serialPort->portName()) << endl;
m_standardOutput << m_readData << endl;
- QCoreApplication::quit();
}
+
+ QCoreApplication::quit();
}
void SerialPortReader::handleError(QSerialPort::SerialPortError serialPortError)