Compare commits
2 Commits
master
...
matchDClow
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7bdd5a019 | ||
|
|
d4665f92ea |
@ -1,4 +1,5 @@
|
||||
Mobile: fix failure to recognize several Aqualung BLE dive computers
|
||||
Core: always include BT/BLE name, even for devices no recognized as dive computer
|
||||
Core: fix failure to recognize several Aqualung BLE dive computers
|
||||
Mobile: show dive tags on dive details page
|
||||
Desktop: update SAC fields and other statistics when editing cylinders
|
||||
Desktop: Reconnect the variations checkbox in planner
|
||||
|
||||
@ -274,8 +274,11 @@ void BTDiscovery::btDeviceDiscoveredMain(const btPairedDevice &device)
|
||||
return;
|
||||
}
|
||||
// Do we want only devices we recognize as dive computers?
|
||||
if (m_showNonDiveComputers)
|
||||
connectionListModel.addAddress(device.address);
|
||||
if (m_showNonDiveComputers) {
|
||||
if (!newDevice.isEmpty())
|
||||
newDevice += " ";
|
||||
connectionListModel.addAddress(newDevice + device.address);
|
||||
}
|
||||
qDebug() << "Not recognized as dive computer";
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include "core/connectionlistmodel.h"
|
||||
#if defined(BT_SUPPORT)
|
||||
#include "core/btdiscovery.h"
|
||||
#endif
|
||||
|
||||
ConnectionListModel::ConnectionListModel(QObject *parent) :
|
||||
QAbstractListModel(parent)
|
||||
@ -31,8 +34,18 @@ int ConnectionListModel::rowCount(const QModelIndex&) const
|
||||
void ConnectionListModel::addAddress(const QString &address)
|
||||
{
|
||||
if (!m_addresses.contains(address)) {
|
||||
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
||||
m_addresses.append(address);
|
||||
int idx = rowCount();
|
||||
#if defined(BT_SUPPORT)
|
||||
// make sure that addresses that are just a BT/BLE address without name stay at the end of the list
|
||||
if (address != extractBluetoothAddress(address)) {
|
||||
for (idx = 0; idx < rowCount(); idx++)
|
||||
if (m_addresses[idx] == extractBluetoothAddress(m_addresses[idx]))
|
||||
// found the first name-less BT/BLE address, insert before that
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
beginInsertRows(QModelIndex(), idx, idx);
|
||||
m_addresses.insert(idx, address);
|
||||
endInsertRows();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user