diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-20 09:35:00 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-20 09:35:00 -0700 |
commit | 43798702ff40586031f480b11a59c21cf7b4228b (patch) | |
tree | 248b77fcdf77b6d4c948fca7325a7231944e48b1 /qt-ui/downloadfromdivecomputer.cpp | |
parent | 947fda14c5d10916572ae1232987684205632c71 (diff) | |
download | subsurface-43798702ff40586031f480b11a59c21cf7b4228b.tar.gz |
Only enable Bluetooth support if building against Qt5.4 or newer
Also remove the quick hack from commit 947fda14c5d1 ("Bluetooth support:
quick build fix for Qt5.2"). I should have thought this through before
pushing that commit, but oh well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 276e4047c..4127376ac 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -100,10 +100,15 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : ui.downloadCancelRetryButton->setEnabled(true); ui.downloadCancelRetryButton->setText(tr("Download")); +#if defined(BT_SUPPORT) btDeviceSelectionDialog = 0; ui.chooseBluetoothDevice->setEnabled(ui.bluetoothMode->isChecked()); connect(ui.bluetoothMode, SIGNAL(stateChanged(int)), this, SLOT(enableBluetoothMode(int))); connect(ui.chooseBluetoothDevice, SIGNAL(clicked()), this, SLOT(selectRemoteBluetoothDevice())); +#else + ui.bluetoothMode->hide(); + ui.chooseBluetoothDevice->hide(); +#endif } void DownloadFromDCWidget::updateProgressBar() @@ -313,11 +318,15 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() data.vendor = strdup(ui.vendor->currentText().toUtf8().data()); data.product = strdup(ui.product->currentText().toUtf8().data()); +#if defined(BT_SUPPORT) data.bluetooth_mode = ui.bluetoothMode->isChecked(); if (data.bluetooth_mode) { // Get the selected device address data.devname = strdup(btDeviceSelectionDialog->getSelectedDeviceAddress().toUtf8().data()); - } else if (same_string(data.vendor, "Uemis")) { + } else + // this breaks an "else if" across lines... not happy... +#endif + if (same_string(data.vendor, "Uemis")) { char *colon; char *devname = strdup(ui.device->currentText().toUtf8().data()); @@ -523,10 +532,13 @@ void DownloadFromDCWidget::markChildrenAsEnabled() ui.chooseDumpFile->setEnabled(true); ui.selectAllButton->setEnabled(true); ui.unselectAllButton->setEnabled(true); +#if defined(BT_SUPPORT) ui.bluetoothMode->setEnabled(true); ui.chooseBluetoothDevice->setEnabled(true); +#endif } +#if defined(BT_SUPPORT) void DownloadFromDCWidget::selectRemoteBluetoothDevice() { if (!btDeviceSelectionDialog) { @@ -555,6 +567,7 @@ void DownloadFromDCWidget::enableBluetoothMode(int state) if (state == Qt::Checked) selectRemoteBluetoothDevice(); } +#endif static void fillDeviceList(const char *name, void *data) { |