diff options
Diffstat (limited to 'examples/serialport/cwriterasync')
-rw-r--r-- | examples/serialport/cwriterasync/main.cpp | 8 | ||||
-rw-r--r-- | examples/serialport/cwriterasync/serialportwriter.cpp | 10 |
2 files changed, 10 insertions, 8 deletions
diff --git a/examples/serialport/cwriterasync/main.cpp b/examples/serialport/cwriterasync/main.cpp index 4d65e0a6..f9cbfce6 100644 --- a/examples/serialport/cwriterasync/main.cpp +++ b/examples/serialport/cwriterasync/main.cpp @@ -66,7 +66,8 @@ int main(int argc, char *argv[]) if (argumentCount == 1) { standardOutput << QObject::tr("Usage: %1 <serialportname> [baudrate]") - .arg(argumentList.first()) << endl; + .arg(argumentList.first()) + << "\n"; return 1; } @@ -82,7 +83,7 @@ int main(int argc, char *argv[]) QFile dataFile; if (!dataFile.open(stdin, QIODevice::ReadOnly)) { - standardOutput << QObject::tr("Failed to open stdin for reading") << endl; + standardOutput << QObject::tr("Failed to open stdin for reading") << "\n"; return 1; } @@ -93,7 +94,8 @@ int main(int argc, char *argv[]) standardOutput << QObject::tr("Either no data was currently available on " "the standard input for reading, " "or an error occurred for port %1, error: %2") - .arg(serialPortName).arg(serialPort.errorString()) << endl; + .arg(serialPortName).arg(serialPort.errorString()) + << "\n"; return 1; } diff --git a/examples/serialport/cwriterasync/serialportwriter.cpp b/examples/serialport/cwriterasync/serialportwriter.cpp index c2916bb2..1f2fedc2 100644 --- a/examples/serialport/cwriterasync/serialportwriter.cpp +++ b/examples/serialport/cwriterasync/serialportwriter.cpp @@ -71,7 +71,7 @@ void SerialPortWriter::handleBytesWritten(qint64 bytes) if (m_bytesWritten == m_writeData.size()) { m_bytesWritten = 0; m_standardOutput << QObject::tr("Data successfully sent to port %1") - .arg(m_serialPort->portName()) << endl; + .arg(m_serialPort->portName()) << "\n"; QCoreApplication::quit(); } } @@ -81,7 +81,7 @@ void SerialPortWriter::handleTimeout() m_standardOutput << QObject::tr("Operation timed out for port %1, error: %2") .arg(m_serialPort->portName()) .arg(m_serialPort->errorString()) - << endl; + << "\n"; QCoreApplication::exit(1); } @@ -92,7 +92,7 @@ void SerialPortWriter::handleError(QSerialPort::SerialPortError serialPortError) " the data to port %1, error: %2") .arg(m_serialPort->portName()) .arg(m_serialPort->errorString()) - << endl; + << "\n"; QCoreApplication::exit(1); } } @@ -107,13 +107,13 @@ void SerialPortWriter::write(const QByteArray &writeData) m_standardOutput << QObject::tr("Failed to write the data to port %1, error: %2") .arg(m_serialPort->portName()) .arg(m_serialPort->errorString()) - << endl; + << "\n"; QCoreApplication::exit(1); } else if (bytesWritten != m_writeData.size()) { m_standardOutput << QObject::tr("Failed to write all the data to port %1, error: %2") .arg(m_serialPort->portName()) .arg(m_serialPort->errorString()) - << endl; + << "\n"; QCoreApplication::exit(1); } |