mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 07:03:24 +00:00
Improve writing of device name to dive computers.
Improves the writing of device name to the dive computer. The code has been updated to use a switch statement. This will make it easier to add new devices in the future. Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com> Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
parent
ee2403d63c
commit
a7a74ae9a6
1 changed files with 6 additions and 5 deletions
|
@ -114,15 +114,16 @@ void WriteSettingsThread::run()
|
|||
rc = dc_device_open(&data->device, data->context, data->descriptor, data->devname);
|
||||
if (rc == DC_STATUS_SUCCESS) {
|
||||
dc_status_t result;
|
||||
if (dc_device_get_type(data->device) == DC_FAMILY_HW_OSTC3) {
|
||||
if (m_settingName == "Name") {
|
||||
if (m_settingName == "Name") {
|
||||
switch (dc_device_get_type(data->device)) {
|
||||
case DC_FAMILY_HW_OSTC3:
|
||||
supported = true;
|
||||
result = hw_ostc3_device_customtext(data->device, m_settingValue.toByteArray().data());
|
||||
}
|
||||
} else if ( dc_device_get_type(data->device) == DC_FAMILY_HW_FROG ) {
|
||||
if (m_settingName == "Name") {
|
||||
break;
|
||||
case DC_FAMILY_HW_FROG:
|
||||
supported = true;
|
||||
result = hw_frog_device_customtext(data->device, m_settingValue.toByteArray().data());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (m_settingName == "DateAndTime") {
|
||||
|
|
Loading…
Add table
Reference in a new issue