diff options
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c index db26190b9..2e456953d 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -1714,6 +1714,14 @@ extern int dm4_events(void *handle, int columns, char **data, char **column) return 0; } +extern int dm4_tags(void *handle, int columns, char **data, char **column) +{ + if(data[0]) + taglist_add_tag(cur_dive->tag_list, data[0]); + + return 0; +} + extern int dm4_dive(void *param, int columns, char **data, char **column) { int i, interval, retval = 0; @@ -1723,6 +1731,7 @@ extern int dm4_dive(void *param, int columns, char **data, char **column) int *pressureBlob; char *err = NULL; char get_events_template[] = "select * from Mark where DiveId = %d"; + char get_tags_template[] = "select Text from DiveTag where DiveId = %d"; char get_events[64]; dive_start(); @@ -1816,6 +1825,13 @@ extern int dm4_dive(void *param, int columns, char **data, char **column) return 1; } + snprintf(get_events, sizeof(get_events) - 1, get_tags_template, cur_dive->number); + retval = sqlite3_exec(handle, get_events, &dm4_tags, 0, &err); + if (retval != SQLITE_OK) { + fprintf(stderr, "%s", translate("gettextFromC","Database query get_tags failed.\n")); + return 1; + } + dive_end(); /* |