mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Bluetooth cleanup: remove pointless download_mode
This was used to track whether we had selected the native BT mode in the download dialog. But the information is redundant as we can tell from the device name whether this is a BT/BLE download or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5b925d29af
commit
a20626a874
4 changed files with 1 additions and 17 deletions
|
@ -63,7 +63,6 @@ typedef struct {
|
|||
const char *product;
|
||||
const char *device;
|
||||
const char *device_name;
|
||||
int download_mode;
|
||||
} dive_computer_prefs_t;
|
||||
|
||||
enum unit_system_values {
|
||||
|
|
|
@ -20,7 +20,6 @@ void qPrefDiveComputer::loadSync(bool doSync)
|
|||
// last computer used
|
||||
disk_device(doSync);
|
||||
disk_device_name(doSync);
|
||||
disk_download_mode(doSync);
|
||||
disk_product(doSync);
|
||||
disk_vendor(doSync);
|
||||
|
||||
|
@ -41,7 +40,6 @@ void qPrefDiveComputer::loadSync(bool doSync)
|
|||
// these are the 'active' settings
|
||||
HANDLE_PREFERENCE_TXT_EXT(DiveComputer, "dive_computer_device", device, dive_computer.)
|
||||
HANDLE_PREFERENCE_TXT_EXT(DiveComputer, "dive_computer_device_name", device_name, dive_computer.)
|
||||
HANDLE_PREFERENCE_INT_EXT(DiveComputer, "dive_computer_download_mode", download_mode, dive_computer.)
|
||||
HANDLE_PREFERENCE_TXT_EXT(DiveComputer, "dive_computer_product", product, dive_computer.)
|
||||
HANDLE_PREFERENCE_TXT_EXT(DiveComputer, "dive_computer_vendor", vendor, dive_computer.)
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ class qPrefDiveComputer : public QObject {
|
|||
Q_PROPERTY(QString vendor2 READ vendor2 WRITE set_vendor2 NOTIFY vendor2Changed)
|
||||
Q_PROPERTY(QString vendor3 READ vendor3 WRITE set_vendor3 NOTIFY vendor3Changed)
|
||||
Q_PROPERTY(QString vendor4 READ vendor4 WRITE set_vendor4 NOTIFY vendor4Changed)
|
||||
Q_PROPERTY(int download_mode READ download_mode WRITE set_download_mode NOTIFY download_modeChanged)
|
||||
|
||||
public:
|
||||
qPrefDiveComputer(QObject *parent = NULL);
|
||||
|
@ -50,7 +49,6 @@ public:
|
|||
IMPLEMENT5GETTERS(device_name)
|
||||
IMPLEMENT5GETTERS(product)
|
||||
IMPLEMENT5GETTERS(vendor)
|
||||
static int download_mode() { return prefs.dive_computer.download_mode; }
|
||||
|
||||
public slots:
|
||||
static void set_device(const QString &device);
|
||||
|
@ -77,8 +75,6 @@ public slots:
|
|||
static void set_vendor3(const QString &vendor);
|
||||
static void set_vendor4(const QString &vendor);
|
||||
|
||||
static void set_download_mode(int mode);
|
||||
|
||||
signals:
|
||||
void deviceChanged(const QString &device);
|
||||
void device1Changed(const QString &device);
|
||||
|
@ -104,8 +100,6 @@ signals:
|
|||
void vendor3Changed(const QString &vendor);
|
||||
void vendor4Changed(const QString &vendor);
|
||||
|
||||
void download_modeChanged(int mode);
|
||||
|
||||
private:
|
||||
// functions to load/sync variable with disk
|
||||
|
||||
|
@ -132,9 +126,6 @@ private:
|
|||
static void disk_vendor2(bool doSync);
|
||||
static void disk_vendor3(bool doSync);
|
||||
static void disk_vendor4(bool doSync);
|
||||
|
||||
static void disk_download_mode(bool doSync);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -94,7 +94,7 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) :
|
|||
QString deviceText = qPrefDiveComputer::device();
|
||||
#if defined(BT_SUPPORT)
|
||||
ui.bluetoothMode->setText(tr("Choose Bluetooth download mode"));
|
||||
ui.bluetoothMode->setChecked(qPrefDiveComputer::download_mode() == DC_TRANSPORT_BLUETOOTH);
|
||||
ui.bluetoothMode->setChecked(isBluetoothAddress(qPrefDiveComputer::device()));
|
||||
btDeviceSelectionDialog = 0;
|
||||
connect(ui.bluetoothMode, SIGNAL(stateChanged(int)), this, SLOT(enableBluetoothMode(int)));
|
||||
connect(ui.chooseBluetoothDevice, SIGNAL(clicked()), this, SLOT(selectRemoteBluetoothDevice()));
|
||||
|
@ -398,10 +398,6 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked()
|
|||
qPrefDiveComputer::set_product(data->product());
|
||||
qPrefDiveComputer::set_device(data->devName());
|
||||
|
||||
#if defined(BT_SUPPORT)
|
||||
qPrefDiveComputer::set_download_mode(ui.bluetoothMode->isChecked() ? DC_TRANSPORT_BLUETOOTH : DC_TRANSPORT_SERIAL);
|
||||
#endif
|
||||
|
||||
// before we start, remember where the dive_table ended
|
||||
previousLast = dive_table.nr;
|
||||
thread.start();
|
||||
|
|
Loading…
Add table
Reference in a new issue