summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-10-27 20:37:10 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-27 14:36:40 -0700
commitaeebe8519d31482230edfc7bc0c144032872b663 (patch)
tree63e8a7496c327f3f06c3e7d83b3428bce58f216a
parentae4015dc105f9d2e94e1dd68e6a79a81a061a9e6 (diff)
downloadsubsurface-aeebe8519d31482230edfc7bc0c144032872b663.tar.gz
Cleanup syntax and styling in Configure DC
This cleans up some styling and syntax in the Configure Dive Computer code path. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--configuredivecomputerthreads.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index 6d12d4d88..668e63831 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -197,7 +197,7 @@ void ReadSettingsThread::run()
m_deviceDetails->setAlarmDepth(depth);
}
emit devicedetails(m_deviceDetails);
- break;
+ break;
}
#if DC_VERSION_CHECK(0, 5, 0)
case DC_FAMILY_HW_OSTC3: {
@@ -433,16 +433,15 @@ void ReadSettingsThread::run()
supported = false;
break;
}
+ } else {
+ lastError = tr("Could not a establish connection to the dive computer.");
+ emit error(lastError);
+ }
unsupported_dc_error:
- dc_device_close(m_data->device);
+ dc_device_close(m_data->device);
- if (!supported) {
- lastError = tr("This feature is not yet available for the selected dive computer.");
- emit error(lastError);
- }
- }
- else {
- lastError = tr("Could not a establish connection to the dive computer.");
+ if (!supported) {
+ lastError = tr("This feature is not yet available for the selected dive computer.");
emit error(lastError);
}
}
@@ -500,8 +499,7 @@ void WriteSettingsThread::run()
dc_device_write(m_data->device, SUUNTO_VYPER_ALARM_DEPTH, data2, 2);
break;
#if DC_VERSION_CHECK(0,5,0)
- case DC_FAMILY_HW_OSTC3:
- {
+ case DC_FAMILY_HW_OSTC3: {
supported = true;
//write gas values
unsigned char gas1Data[4] = {m_deviceDetails->gas1().oxygen,