diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-06-29 19:47:51 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-30 13:12:53 -0700 |
commit | c145cbd75444508d3a48e8b363abbbb52eb5ed12 (patch) | |
tree | a954ddbfc15f41507aca3b57b8fd32b7f27846e4 /core | |
parent | 6837120bb121cd40ec8fc83424849af1ed3756be (diff) | |
download | subsurface-c145cbd75444508d3a48e8b363abbbb52eb5ed12.tar.gz |
QML UI: save BT address as string
And do the same LE: prefix marking as in the desktop version.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/btdiscovery.cpp | 8 | ||||
-rw-r--r-- | core/btdiscovery.h | 2 | ||||
-rw-r--r-- | core/downloadfromdcthread.cpp | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp index 2b7ef4ce6..1326b175b 100644 --- a/core/btdiscovery.cpp +++ b/core/btdiscovery.cpp @@ -72,7 +72,7 @@ BTDiscovery::BTDiscovery(QObject *parent) } #endif for (int i = 0; i < btPairedDevices.length(); i++) { - qDebug() << "Paired =" << btPairedDevices[i].name << btPairedDevices[i].address.toString(); + qDebug() << "Paired =" << btPairedDevices[i].name << btPairedDevices[i].address; } #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) discoveryAgent->stop(); @@ -121,7 +121,7 @@ void BTDiscovery::btDeviceDiscovered(const QBluetoothDeviceInfo &device) { #if defined(SSRF_CUSTOM_IO) btPairedDevice this_d; - this_d.address = device.address(); + this_d.address = markBLEAddress(&device); this_d.name = device.name(); btPairedDevices.append(this_d); @@ -161,7 +161,7 @@ void BTDiscovery::btDeviceDiscoveredMain(const btPairedDevice &device) break; } } - productList[QObject::tr("Paired Bluetooth Devices")].append(device.name + " (" + device.address.toString() + ")"); + productList[QObject::tr("Paired Bluetooth Devices")].append(device.name + " (" + device.address + ")"); btVP.btpdi = device; btVP.dcDescriptor = newDC; @@ -218,7 +218,7 @@ void BTDiscovery::getBluetoothDevices() continue; } - result.address = QBluetoothAddress(dev.callObjectMethod("getAddress","()Ljava/lang/String;").toString()); + result.address = dev.callObjectMethod("getAddress","()Ljava/lang/String;").toString(); result.name = dev.callObjectMethod("getName", "()Ljava/lang/String;").toString(); btPairedDevices.append(result); diff --git a/core/btdiscovery.h b/core/btdiscovery.h index a99b29b3c..0bf2ca448 100644 --- a/core/btdiscovery.h +++ b/core/btdiscovery.h @@ -27,7 +27,7 @@ public: #if defined(BT_SUPPORT) struct btPairedDevice { - QBluetoothAddress address; + QString address; QString name; }; diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index 7a3a22c6e..cdbb3c53f 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -331,7 +331,7 @@ QString DCDeviceData::getDetectedDeviceAddress(const QString ¤tVendorText, // 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().btpdi.address.toString(); + QString btAddr = btDCs.first().btpdi.address; qDebug() << "getDetectedDeviceAddress" << btAddr; return btAddr; } @@ -340,7 +340,7 @@ QString DCDeviceData::getDetectedDeviceAddress(const QString ¤tVendorText, // unsure being a dive computer if (currentVendorText == QObject::tr("Paired Bluetooth Devices")) { int i = productList[currentVendorText].indexOf(currentProductText); - QString btAddr = btAllDevices[i].btpdi.address.toString(); + QString btAddr = btAllDevices[i].btpdi.address; qDebug() << "getDetectedDeviceAddress" << btAddr; return btAddr; } |