diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2017-07-23 21:54:41 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-24 13:08:04 +0900 |
commit | a7231be9a0220e343537be9d962b33b44ef397d4 (patch) | |
tree | 8bd3a6c667d086adb1e10f57b472e7fa9a82d1e6 /core | |
parent | c69a56b53b65d03ea264ff8bc45cbd115527ec2f (diff) | |
download | subsurface-a7231be9a0220e343537be9d962b33b44ef397d4.tar.gz |
Detect CCR/PSCR from Divinglog import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/parse-xml.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c index 65c3eee6b..e6861d44d 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -3375,6 +3375,19 @@ extern int divinglog_dive(void *param, int columns, char **data, char **column) return 1; } + if (data[15]) { + switch (data[15][0]) { + /* OC */ + case '0': + break; + case '1': + cur_dive->dc.divemode = PSCR; + break; + case '2': + cur_dive->dc.divemode = CCR; + break; + } + } dc_settings_end(); settings_end(); @@ -3408,7 +3421,7 @@ int parse_divinglog_buffer(sqlite3 *handle, const char *url, const char *buffer, char *err = NULL; target_table = table; - char get_dives[] = "select Number,strftime('%s',Divedate || ' ' || ifnull(Entrytime,'00:00')),Country || ' - ' || City || ' - ' || Place,Buddy,Comments,Depth,Divetime,Divemaster,Airtemp,Watertemp,Weight,Divesuit,Computer,ID,Visibility from Logbook where UUID not in (select UUID from DeletedRecords)"; + char get_dives[] = "select Number,strftime('%s',Divedate || ' ' || ifnull(Entrytime,'00:00')),Country || ' - ' || City || ' - ' || Place,Buddy,Comments,Depth,Divetime,Divemaster,Airtemp,Watertemp,Weight,Divesuit,Computer,ID,Visibility,SupplyType from Logbook where UUID not in (select UUID from DeletedRecords)"; retval = sqlite3_exec(handle, get_dives, &divinglog_dive, handle, &err); |