Hi there,

I believe that it is a little confusing that in order to compile and
to make work the Bluetooth support, two different macros
should be defined (BTSUPPORT and SSRF_CUSTOM_SERIAL).

Even thought the first one is defined, the implementation will not
work without the second one. Therefore I believe that it is a good
idea to disable the Bluetooth option from GUI if SSRF_CUSTOM_SERIAL
is not defined. I attached a patch which will do the trick.

Another solution would be to disable the BTSUPPORT option from cmake
if SSRF_CUSTOM_SERIAL is not defined. Unfortunately I don't
have too much experience with cmake and I don't know how to do that.

Claudiu
From 87c860fa35109c0b03ee9dabc102d1667fd33195 Mon Sep 17 00:00:00 2001
From: Claudiu Olteanu <olteanu.clau...@ymail.com>
Date: Tue, 8 Sep 2015 19:29:36 +0300
Subject: [PATCH] Disable Bth option from GUI if the SSRF_CUSTOM_SERIAL is
 undefined

The Bluetooth implementation doesn't work is SSRF_CUSTOM_SERIAL
is undefined. Therefore it is a good idea to remove it from
the UI if the libdivecomputer version is wrong.

Signed-off-by: Claudiu Olteanu <olteanu.clau...@ymail.com>
---
 qt-ui/downloadfromdivecomputer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index f2378d5..71761bf 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -100,7 +100,7 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) :
 	ui.downloadCancelRetryButton->setEnabled(true);
 	ui.downloadCancelRetryButton->setText(tr("Download"));
 
-#if defined(BT_SUPPORT)
+#if defined(BT_SUPPORT) && defined(SSRF_CUSTOM_SERIAL)
 	ui.bluetoothMode->setText(tr("Choose Bluetooth download mode"));
 	ui.bluetoothMode->setChecked(default_dive_computer_download_mode == DC_TRANSPORT_BLUETOOTH);
 	btDeviceSelectionDialog = 0;
-- 
2.1.4

_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to