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 <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Jan Mulder 2017-06-08 14:15:22 +02:00 committed by Dirk Hohndel
parent a7288cc912
commit f6e94e691f
2 changed files with 5 additions and 5 deletions

View file

@ -247,7 +247,7 @@ int DCDeviceData::getDetectedVendorIndex()
#if defined(BT_SUPPORT) #if defined(BT_SUPPORT)
QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs(); QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
if (!btDCs.isEmpty()) { if (!btDCs.isEmpty()) {
qDebug() << "getVendorIdx" << btDCs.first().vendorIdx; qDebug() << "getDetectedVendorIndex" << btDCs.first().vendorIdx;
return btDCs.first().vendorIdx; return btDCs.first().vendorIdx;
} }
#endif #endif
@ -259,7 +259,7 @@ int DCDeviceData::getDetectedProductIndex()
#if defined(BT_SUPPORT) #if defined(BT_SUPPORT)
QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs(); QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
if (!btDCs.isEmpty()) { if (!btDCs.isEmpty()) {
qDebug() << "getProductIdx" << btDCs.first().productIdx; qDebug() << "getDetectedProductIndex" << btDCs.first().productIdx;
return btDCs.first().productIdx; return btDCs.first().productIdx;
} }
#endif #endif
@ -272,7 +272,7 @@ QString DCDeviceData::getDetectedDeviceAddress()
QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs(); QList<btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
if (!btDCs.isEmpty()) { if (!btDCs.isEmpty()) {
QString btAddr = btDCs.first().btdi.address().toString(); QString btAddr = btDCs.first().btdi.address().toString();
qDebug() << "getBtAddress" << btAddr; qDebug() << "getDetectedDeviceAddress" << btAddr;
return btAddr; return btAddr;
} }
return QString(); return QString();

View file

@ -89,11 +89,11 @@ Kirigami.Page {
onClicked: { onClicked: {
text: qsTr("Retry") text: qsTr("Retry")
if (downloadThread.deviceData.bluetoothMode) { if (downloadThread.deviceData.bluetoothMode) {
var addr = manager.getBtAddress() var addr = downloadThread.data().getDetectedDeviceAddress()
if (addr !== "") if (addr !== "")
downloadThread.deviceData.devName = addr downloadThread.deviceData.devName = addr
} }
manager.appendTextToLog("DCDownloadThread started from " + downloadThread.deviceData.devName) manager.appendTextToLog("DCDownloadThread started for " + downloadThread.deviceData.devName)
downloadThread.start() downloadThread.start()
} }
} }