[PATCH 3/5] Use libdivecomputer libc wrappers instead of Qt

Anton Lundin glance at acc.umu.se
Fri Jan 22 05:17:48 PST 2016


Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 subsurface-core/configuredivecomputerthreads.cpp | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/subsurface-core/configuredivecomputerthreads.cpp b/subsurface-core/configuredivecomputerthreads.cpp
index ececa85..e681649 100644
--- a/subsurface-core/configuredivecomputerthreads.cpp
+++ b/subsurface-core/configuredivecomputerthreads.cpp
@@ -1,7 +1,6 @@
 #include "configuredivecomputerthreads.h"
 #include "libdivecomputer/hw.h"
 #include "libdivecomputer.h"
-#include <QDateTime>
 
 #define OSTC3_GAS1			0x10
 #define OSTC3_GAS2			0x11
@@ -918,15 +917,10 @@ static dc_status_t write_ostc3_settings(dc_device_t *device, DeviceDetails *m_de
 
 	//sync date and time
 	if (m_deviceDetails->syncTime) {
-		QDateTime timeToSet = QDateTime::currentDateTime();
-		dc_datetime_t time;
-		time.year = timeToSet.date().year();
-		time.month = timeToSet.date().month();
-		time.day = timeToSet.date().day();
-		time.hour = timeToSet.time().hour();
-		time.minute = timeToSet.time().minute();
-		time.second = timeToSet.time().second();
-		rc = hw_ostc3_device_clock(device, &time);
+		dc_datetime_t now;
+		dc_datetime_localtime(&now, dc_datetime_now());
+
+		rc = hw_ostc3_device_clock(device, &now);
 	}
 	EMIT_PROGRESS();
 
-- 
2.5.0



More information about the subsurface mailing list