summaryrefslogtreecommitdiffstats
path: root/core/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-07-23 08:42:58 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-24 10:03:07 +0900
commit27bb76e8340606d9fd6183befe68d2a04c2d1d23 (patch)
treebd49a42f9fb22fe6ea530a6035e2bedaf601a98d /core/parse-xml.c
parent04213e1f0314c0f3597654698bbb2f2d3847c930 (diff)
downloadsubsurface-27bb76e8340606d9fd6183befe68d2a04c2d1d23.tar.gz
Add visibility support to Divinglog import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'core/parse-xml.c')
-rw-r--r--core/parse-xml.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c
index f3c2e0de8..5d5a8f8b9 100644
--- a/core/parse-xml.c
+++ b/core/parse-xml.c
@@ -3348,6 +3348,10 @@ extern int divinglog_dive(void *param, int columns, char **data, char **column)
if (data[11])
cur_dive->suit = strdup(data[11]);
+ /* TODO: check what the visibility options are in Divinglog and map them to Subsurface's 0-5 scale */
+ if (data[14])
+ cur_dive->visibility = atoi(data[14]);
+
settings_start();
dc_settings_start();
@@ -3404,7 +3408,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 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 from Logbook where UUID not in (select UUID from DeletedRecords)";
retval = sqlite3_exec(handle, get_dives, &divinglog_dive, handle, &err);