From f6e94e691f49c1df6c161bfd2961fa28edbf84d3 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Thu, 8 Jun 2017 14:15:22 +0200 Subject: QML UI: call correct function for BT address After the recent refactoring of QMLManager to btdiscovery, the manager.getBtAddress() got superseeded by downloadThread.data().getDetectedDeviceAddress(). Corrected this here. Futher some debug output is modified, so that it report the proper function names. This corrects the download from an automatically detected OSTC 3. Manul selection of the same device from the fake vendor "Paired BT Devices" does not work, however. Still work to be done in that area. Signed-off-by: Jan Mulder Signed-off-by: Dirk Hohndel --- core/downloadfromdcthread.cpp | 6 +++--- mobile-widgets/qml/DownloadFromDiveComputer.qml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index 9583eff15..43bd1e0b8 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -247,7 +247,7 @@ int DCDeviceData::getDetectedVendorIndex() #if defined(BT_SUPPORT) QList btDCs = BTDiscovery::instance()->getBtDcs(); if (!btDCs.isEmpty()) { - qDebug() << "getVendorIdx" << btDCs.first().vendorIdx; + qDebug() << "getDetectedVendorIndex" << btDCs.first().vendorIdx; return btDCs.first().vendorIdx; } #endif @@ -259,7 +259,7 @@ int DCDeviceData::getDetectedProductIndex() #if defined(BT_SUPPORT) QList btDCs = BTDiscovery::instance()->getBtDcs(); if (!btDCs.isEmpty()) { - qDebug() << "getProductIdx" << btDCs.first().productIdx; + qDebug() << "getDetectedProductIndex" << btDCs.first().productIdx; return btDCs.first().productIdx; } #endif @@ -272,7 +272,7 @@ QString DCDeviceData::getDetectedDeviceAddress() QList btDCs = BTDiscovery::instance()->getBtDcs(); if (!btDCs.isEmpty()) { QString btAddr = btDCs.first().btdi.address().toString(); - qDebug() << "getBtAddress" << btAddr; + qDebug() << "getDetectedDeviceAddress" << btAddr; return btAddr; } return QString(); diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 8b9f642ff..6a24f2dc9 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -89,11 +89,11 @@ Kirigami.Page { onClicked: { text: qsTr("Retry") if (downloadThread.deviceData.bluetoothMode) { - var addr = manager.getBtAddress() + var addr = downloadThread.data().getDetectedDeviceAddress() if (addr !== "") downloadThread.deviceData.devName = addr } - manager.appendTextToLog("DCDownloadThread started from " + downloadThread.deviceData.devName) + manager.appendTextToLog("DCDownloadThread started for " + downloadThread.deviceData.devName) downloadThread.start() } } -- cgit v1.2.3-70-g09d2