Make Bluetooth naming consistent

Currently, on Linux, after selecting a Bluetooth device the name of the
device is shown. On reopening the download dialog, on the other hand,
the address is shown. In the device selection dialog both are shown.

This patch changes the download dialog such that both, name and address,
are shown. The bulk of the patch introduces the name of the device in
the preferences and DCDeviceData. It has to be noted that DCDeviceData
is an encapsulation of the libdivecomputer device_data_t. Nevertheless,
the new Bluetooth-name field is, at the moment, not passed through to
libdivecomputer.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2017-11-12 12:33:20 +01:00 committed by Dirk Hohndel
parent 0d023068b3
commit de81effb25
9 changed files with 69 additions and 11 deletions

View file

@ -56,6 +56,7 @@ void DownloadThread::run()
dcs->setVendor(internalData->vendor);
dcs->setProduct(internalData->product);
dcs->setDevice(internalData->devname);
dcs->setDeviceName(m_data->devBluetoothName());
}
static void fill_supported_mobile_list()
@ -239,6 +240,11 @@ QString DCDeviceData::devName() const
return data.devname;
}
QString DCDeviceData::devBluetoothName() const
{
return m_devBluetoothName;
}
QString DCDeviceData::descriptor() const
{
return "";
@ -284,6 +290,11 @@ void DCDeviceData::setDevName(const QString& devName)
data.devname = strdup(qPrintable(devName));
}
void DCDeviceData::setDevBluetoothName(const QString& name)
{
m_devBluetoothName = name;
}
void DCDeviceData::setBluetoothMode(bool mode)
{
data.bluetooth_mode = mode;