summaryrefslogtreecommitdiffstats
path: root/core/downloadfromdcthread.cpp
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-06-12 10:38:24 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-06-12 11:05:08 -0700
commit23df5938172cb1e76c5f154caf10a2d462916cfc (patch)
treef7c8fbe7f95fa151ad0f4930c9f53ef8ff901cac /core/downloadfromdcthread.cpp
parent5142d7409f9dc9a102ae9b5898b43b57621c660c (diff)
downloadsubsurface-23df5938172cb1e76c5f154caf10a2d462916cfc.tar.gz
Mobile: wrap up fixes for BT download on Android
Major functional change in this commit is the addition of found static BT devices to the internal administration (on Android), in a way that is equivalent to mobile-on-desktop. So, in both cases, the list of devices in the app are as in the list of devices on the host OS (Linux or Android). To minimize code duplication, the btDeviceDiscovered slot is split in two parts, the part to act as slot for the Qt BT discovery agent (Linux, so mobile-on-desktop), and the part only needed for Android. Remaining to be fixed: the correct handling of the QML UI selection of vendor/product. The first default dive computer is correctly detected, all paired devices from the virtual vendow can be selected, but clicking through vendors results in non logical selections. It is obvious why this is, but a fix is not straigforward at this point. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/downloadfromdcthread.cpp')
-rw-r--r--core/downloadfromdcthread.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp
index a98ab17b2..98130b730 100644
--- a/core/downloadfromdcthread.cpp
+++ b/core/downloadfromdcthread.cpp
@@ -245,8 +245,8 @@ device_data_t* DCDeviceData::internalData()
int DCDeviceData::getDetectedVendorIndex(const QString &currentText)
{
#if defined(BT_SUPPORT)
- QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
- QList<btVendorProduct> btAllDevices = BTDiscovery::instance()->getBtAllDevices();
+ QList<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
+ QList<BTDiscovery::btVendorProduct> btAllDevices = BTDiscovery::instance()->getBtAllDevices();
// Pick the vendor of the first confirmed find of a DC (if any), but
// only return a true vendor, and not our virtual one
@@ -268,7 +268,7 @@ int DCDeviceData::getDetectedProductIndex(const QString &currentVendorText,
const QString &currentProductText)
{
#if defined(BT_SUPPORT)
- QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
+ QList<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
// Display in the QML UI, the first found dive computer that is been
// detected as a possible real dive computer (and not some other paired
@@ -291,14 +291,14 @@ QString DCDeviceData::getDetectedDeviceAddress(const QString &currentVendorText,
const QString &currentProductText)
{
#if defined(BT_SUPPORT)
- QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
- QList<btVendorProduct> btAllDevices = BTDiscovery::instance()->getBtAllDevices();
+ QList<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
+ QList<BTDiscovery::btVendorProduct> btAllDevices = BTDiscovery::instance()->getBtAllDevices();
// Pull the BT address from the first found dive computer that is been
// detected as a possible real dive computer (and not some other paired
// BT device
if (currentVendorText != QObject::tr("Paired Bluetooth Devices") && !btDCs.isEmpty()) {
- QString btAddr = btDCs.first().btdi.address().toString();
+ QString btAddr = btDCs.first().btpdi.address.toString();
qDebug() << "getDetectedDeviceAddress" << btAddr;
return btAddr;
}
@@ -307,7 +307,7 @@ QString DCDeviceData::getDetectedDeviceAddress(const QString &currentVendorText,
// unsure being a dive computer
if (currentVendorText == QObject::tr("Paired Bluetooth Devices")) {
int i = productList[currentVendorText].indexOf(currentProductText);
- QString btAddr = btAllDevices[i].btdi.address().toString();
+ QString btAddr = btAllDevices[i].btpdi.address.toString();
qDebug() << "getDetectedDeviceAddress" << btAddr;
return btAddr;
}
@@ -319,8 +319,8 @@ QString DCDeviceData::getDeviceDescriptorVendor(const QString &currentVendorText
const QString &currentProductText)
{
#if defined(BT_SUPPORT)
- QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
- QList<btVendorProduct> btAllDevices = BTDiscovery::instance()->getBtAllDevices();
+ QList<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
+ QList<BTDiscovery::btVendorProduct> btAllDevices = BTDiscovery::instance()->getBtAllDevices();
// Pull the vendor from the first found dive computer that is been
// detected as a possible real dive computer (and not some other paired
@@ -347,8 +347,8 @@ QString DCDeviceData::getDeviceDescriptorProduct(const QString &currentVendorTex
const QString &currentProductText)
{
#if defined(BT_SUPPORT)
- QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
- QList<btVendorProduct> btAllDevices = BTDiscovery::instance()->getBtAllDevices();
+ QList<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
+ QList<BTDiscovery::btVendorProduct> btAllDevices = BTDiscovery::instance()->getBtAllDevices();
// Pull the product from the first found dive computer that is been
// detected as a possible real dive computer (and not some other paired