Hi,

On 29. Jun 2017, at 23:17, Dirk Hohndel <[email protected]> wrote:

upon scanning I also see this (part of the time). Usually waiting a bit longer shows also the correct address, latest after restarting the scanning. Maybe we should filter 0 as address as that I guess would never be correct.

That certainly seems reasonable.


I tried to create a PR but Travis fails https://travis-ci.org/Subsurface-divelog/subsurface/builds/248550016?utm_source=github_status&utm_medium=notification during sudo apt-get. If I understand that web page correctly this might be due to the fact that Travis updated to Debian trusty. 

Anyway, here is the patch the old way.

Best
Robert

From d3895673e41c12a73408e6477e9c36fb4dcd9724 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Thu, 29 Jun 2017 23:37:30 +0200
Subject: [PATCH] BT address 0 is bogus
To: [email protected]

Grey out those devices in the scanning list and prevent
the user from selecting those.

Signed-off-by: Robert C. Helling <[email protected]>
---
 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)

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to