Desktop: only show dive computers in the Bluetooth device list

By default we'll only show devices that we believe to be dive computers,
but the user can override that with the recently introduced check box.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-02-12 07:35:35 -08:00
parent 7b0cfb1772
commit f35a0f3b09
3 changed files with 10 additions and 1 deletions

View file

@ -172,6 +172,9 @@ void BtDeviceSelectionDialog::hostModeStateChanged(QBluetoothLocalDevice::HostMo
void BtDeviceSelectionDialog::addRemoteDevice(const QBluetoothDeviceInfo &remoteDeviceInfo)
{
// are we supposed to show all devices or just dive computers?
if (!ui->showNonDivecomputers->isChecked() && !matchesKnownDiveComputerNames(remoteDeviceInfo.name()))
return;
#if defined(Q_OS_WIN)
// On Windows we cannot obtain the pairing status so we set only the name and the address of the device
QString deviceLabel = QString("%1 (%2)").arg(remoteDeviceInfo.name(),