summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/serialport/qserialportinfo_mac.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/serialport/qserialportinfo_mac.cpp b/src/serialport/qserialportinfo_mac.cpp
index 51864893..a1e9e0ef 100644
--- a/src/serialport/qserialportinfo_mac.cpp
+++ b/src/serialport/qserialportinfo_mac.cpp
@@ -97,11 +97,6 @@ static bool isCompleteInfo(const QSerialPortInfoPrivate &priv)
&& priv.hasVendorIdentifier;
}
-static QString devicePortName(io_registry_entry_t ioRegistryEntry)
-{
- return searchStringProperty(ioRegistryEntry, QCFString(kIOTTYDeviceKey));
-}
-
static QString deviceSystemLocation(io_registry_entry_t ioRegistryEntry)
{
return searchStringProperty(ioRegistryEntry, QCFString(kIOCalloutDeviceKey));
@@ -171,11 +166,11 @@ QList<QSerialPortInfo> QSerialPortInfo::availablePorts()
QSerialPortInfoPrivate priv;
forever {
- if (priv.portName.isEmpty())
- priv.portName = devicePortName(serialPortService);
-
- if (priv.device.isEmpty())
+ if (priv.device.isEmpty()) {
priv.device = deviceSystemLocation(serialPortService);
+ if (!priv.device.isEmpty())
+ priv.portName = QSerialPortInfoPrivate::portNameFromSystemLocation(priv.device);
+ }
if (priv.description.isEmpty())
priv.description = deviceDescription(serialPortService);