summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-09 09:38:50 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-09 09:38:50 -0700
commita26719c5419754b24a16b7c8163d236eae765a6d (patch)
tree6c735fa8d100686cd06c679584c3632b41347b00 /parse-xml.c
parentb0983d9d13d2d967d52a0fbbc1052f7f6eca840a (diff)
downloadsubsurface-a26719c5419754b24a16b7c8163d236eae765a6d.tar.gz
Picture handling: switch to stronger typed offset
Also change the on file XML to be even easier to read by making it a duration as well (which gets us '32:34 min' instead of un-typed seconds). This is backwards compatible, it will happily read what was written with the previous commit). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 1fad25bbb..739115dcc 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1084,7 +1084,7 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
if (MATCH("filename.picture", utf8_string, &cur_picture->filename))
return;
- if (MATCH("offset.picture", get_index, &cur_picture->offset))
+ if (MATCH("offset.picture", sampletime, &cur_picture->offset))
return;
if (MATCH("gps.picture", gps_picture_location, cur_picture))
return;
@@ -1295,7 +1295,7 @@ static void event_end(void)
if (cur_event.type == 123) {
struct picture *pic = alloc_picture();
pic->filename = strdup(cur_event.name);
- pic->offset = cur_event.time.seconds;
+ pic->offset = cur_event.time;
dive_add_picture(cur_dive, pic);
} else {
add_event(dc, cur_event.time.seconds,