From d3895673e41c12a73408e6477e9c36fb4dcd9724 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Thu, 29 Jun 2017 23:37:30 +0200 Subject: [PATCH] BT address 0 is bogus To: subsurface@subsurface-divelog.org Grey out those devices in the scanning list and prevent the user from selecting those. Signed-off-by: Robert C. Helling --- desktop-widgets/btdeviceselectiondialog.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/desktop-widgets/btdeviceselectiondialog.cpp b/desktop-widgets/btdeviceselectiondialog.cpp index 2fa6b7679..94e07c969 100644 --- a/desktop-widgets/btdeviceselectiondialog.cpp +++ b/desktop-widgets/btdeviceselectiondialog.cpp @@ -233,6 +233,9 @@ void BtDeviceSelectionDialog::addRemoteDevice(const QBluetoothDeviceInfo &remote pairingStatusLabel = tr("AUTHORIZED_PAIRED"); pairingColor = QColor(Qt::blue); } + if (remoteDeviceInfo.address().isNull()) + pairingColor = QColor(Qt::gray); + QString deviceLabel = tr("%1 (%2) [State: %3]").arg(remoteDeviceInfo.name(), remoteDeviceInfo.address().toString(), @@ -264,6 +267,10 @@ void BtDeviceSelectionDialog::itemClicked(QListWidgetItem *item) .arg(remoteDeviceInfo.address().toString()); enableSaveButton = false; } + if (remoteDeviceInfo.address().isNull()) { + statusMessage = tr("A device needs a non-zero address for a connection."); + enableSaveButton = false; + } #endif // Update the status message and the save button ui->dialogStatus->setText(statusMessage); -- 2.11.0 (Apple Git-81)