summaryrefslogtreecommitdiffstats
path: root/subsurface-mobile-helper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-14 04:01:12 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-14 04:01:12 -0700
commit0039c61dce78ab148b05ceec3283a3bd29e1bb30 (patch)
treed8a429a53cb42e69a017ac4534fedfb075880a1f /subsurface-mobile-helper.cpp
parentaa7e78611ec87ce928f62a41311d47dec016ba97 (diff)
parentba4058667a21a278a394054fea70595358ac41f2 (diff)
downloadsubsurface-0039c61dce78ab148b05ceec3283a3bd29e1bb30.tar.gz
Merge branch 'dynamic-bt' of https://github.com/janmulder/subsurface
Diffstat (limited to 'subsurface-mobile-helper.cpp')
-rw-r--r--subsurface-mobile-helper.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp
index 56ad029e1..ae7143404 100644
--- a/subsurface-mobile-helper.cpp
+++ b/subsurface-mobile-helper.cpp
@@ -30,6 +30,19 @@
QObject *qqWindowObject = NULL;
+void set_non_bt_addresses() {
+#if defined(Q_OS_ANDROID)
+ connectionListModel.addAddress("FTDI");
+#elif defined(Q_OS_LINUX) // since this is in the else, it does NOT include Android
+ connectionListModel.addAddress("/dev/ttyS0");
+ connectionListModel.addAddress("/dev/ttyS1");
+ connectionListModel.addAddress("/dev/ttyS2");
+ connectionListModel.addAddress("/dev/ttyS3");
+ // this makes debugging so much easier - use the simulator
+ connectionListModel.addAddress("/tmp/ttyS1");
+#endif
+}
+
void init_ui()
{
init_qt_late();
@@ -76,16 +89,8 @@ void run_ui()
ctxt->setContextProperty("diveModel", sortModel);
ctxt->setContextProperty("gpsModel", gpsSortModel);
ctxt->setContextProperty("vendorList", vendorList);
-#if defined(Q_OS_ANDROID)
- connectionListModel.addAddress("FTDI");
-#elif defined(Q_OS_LINUX) // since this is in the else, it does NOT include Android
- connectionListModel.addAddress("/dev/ttyS0");
- connectionListModel.addAddress("/dev/ttyS1");
- connectionListModel.addAddress("/dev/ttyS2");
- connectionListModel.addAddress("/dev/ttyS3");
- // this makes debugging so much easier - use the simulator
- connectionListModel.addAddress("/tmp/ttyS1");
-#endif
+ set_non_bt_addresses();
+
ctxt->setContextProperty("connectionListModel", &connectionListModel);
ctxt->setContextProperty("logModel", MessageHandlerModel::self());