[PATCH 6/6] Cleanup syntax and styling in Configure DC

Anton Lundin glance at acc.umu.se
Mon Oct 27 12:37:10 PDT 2014


This cleans up some styling and syntax in the Configure Dive Computer
code path.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 configuredivecomputerthreads.cpp | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index bb6e903..ca29dff 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,
-- 
1.9.1



More information about the subsurface mailing list