From 5d626bb3a510956415a43739211b7d127de0757f Mon Sep 17 00:00:00 2001
From: Martin Storsjo <martin@martin.st>
Date: Fri, 9 Sep 2011 12:01:18 +0300
Subject: runonphone: Include USB serial ports on OS X for CODA, too

The actual devices are already detected in serenum_unix.cpp, but
when used with CODA, the eligible /dev entries apparently need
to be listed here, too.

Reviewed-By: Shane Kearns
Merge-Request: 1373
---
 tools/runonphone/symbianutils/symbiandevicemanager.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/runonphone/symbianutils/symbiandevicemanager.cpp b/tools/runonphone/symbianutils/symbiandevicemanager.cpp
index 23f5348..e8d0b5e 100644
--- a/tools/runonphone/symbianutils/symbiandevicemanager.cpp
+++ b/tools/runonphone/symbianutils/symbiandevicemanager.cpp
@@ -57,6 +57,7 @@
 #include <QtCore/QThread>
 #include <QtCore/QWaitCondition>
 #include <QtCore/QTimer>
+#include <QtCore/QDir>
 
 namespace SymbianUtils {
 
@@ -622,6 +623,20 @@ SymbianDeviceManager::SymbianDeviceList SymbianDeviceManager::blueToothDevices()
         }
     }
 #endif
+#if defined(Q_OS_MAC)
+    QDir dir("/dev");
+    QStringList filters;
+    filters << "cu.usbmodem*";
+    dir.setNameFilters(filters);
+    QStringList entries = dir.entryList(QDir::System, QDir::Name);
+    foreach (const QString &dev, entries) {
+        SymbianDeviceData *device = new SymbianDeviceData;
+        device->type = SerialPortCommunication;
+        device->portName = dir.filePath(dev);
+        device->friendlyName = tr("USB/Serial device (%1)").arg(device->portName);
+        rc.push_back(SymbianDevice(device));
+    }
+#endif
     return rc;
 }
 
-- 
cgit v0.12