diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-07-11 10:49:06 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2016-07-11 09:04:12 +0000 |
commit | 86b6a8f27a098d764a5c2f7dc37edb349bd28c3c (patch) | |
tree | 4248e181876381f57768d82180a766cf12f41d72 | |
parent | 09f6a0f1cacd8d04d5ec8413eed712308395f962 (diff) | |
download | qtserialport-86b6a8f27a098d764a5c2f7dc37edb349bd28c3c.tar.gz |
QSerialPortInfo: use delegate ctor to de-duplicate code
Change-Id: I698b9afc7b15bdfca7176ea3ec823da1ba91957c
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r-- | src/serialport/qserialportinfo.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/serialport/qserialportinfo.cpp b/src/serialport/qserialportinfo.cpp index 2b69966..d978665 100644 --- a/src/serialport/qserialportinfo.cpp +++ b/src/serialport/qserialportinfo.cpp @@ -87,14 +87,8 @@ QSerialPortInfo::QSerialPortInfo(const QSerialPortInfo &other) Constructs a QSerialPortInfo object from serial \a port. */ QSerialPortInfo::QSerialPortInfo(const QSerialPort &port) + : QSerialPortInfo(port.portName()) { - const auto infos = QSerialPortInfo::availablePorts(); - for (const QSerialPortInfo &info : infos) { - if (port.portName() == info.portName()) { - *this = info; - break; - } - } } /*! |