diff options
author | Laszlo Papp <lpapp@kde.org> | 2013-10-11 12:31:45 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-11 14:54:41 +0200 |
commit | 58a82feaff4fc10082a365a77ca0e286bbd138c2 (patch) | |
tree | 61ce1028890b64772ae1f1b034d0a72eb1756da5 | |
parent | 50ab4d4a8ff5f882b9699cbde26ad9d8824a4824 (diff) | |
download | qtserialport-58a82feaff4fc10082a365a77ca0e286bbd138c2.tar.gz |
Do not print a warning for the serialport closure if it is not open
This is necessary because end users will get a warning needlessly if the serial
port is not open when using the library.
There are two alternatives:
* Close in the destructor only if it is open.
* Do not print a warning.
The latter approach is more consistent with the other QIODevice subclasses, so
it is better to stick to that for now.
Change-Id: I918c203b1f5c52fba20de1373c298b8527a0e5a1
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
-rw-r--r-- | src/serialport/qserialport.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index 04f2f9f..587e482 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -497,7 +497,6 @@ void QSerialPort::close() Q_D(QSerialPort); if (!isOpen()) { setError(QSerialPort::NotOpenError); - qWarning("%s: device not open", Q_FUNC_INFO); return; } |