From 58f2613daeabeb3f7470d4e26af7a7ad75624d5e Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 3 Jun 2014 14:26:27 -0300 Subject: [PATCH] Add photo saving for the XML backend. This code correctly saves the added pictures on the xml backend. next: git backend. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- save-xml.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/save-xml.c b/save-xml.c index e52cfdffd..5f61af77f 100644 --- a/save-xml.c +++ b/save-xml.c @@ -369,6 +369,18 @@ static void save_dc(struct membuffer *b, struct dive *dive, struct divecomputer put_format(b, " \n"); } +static void save_picture(struct membuffer *b, struct picture *pic) +{ + put_string(b, " latitude.udeg || pic->longitude.udeg) { + put_degrees(b, pic->latitude, " gps='", " "); + put_degrees(b, pic->longitude, "", "'"); + } + put_string(b, "/>\n"); +} + void save_one_dive(struct membuffer *b, struct dive *dive) { struct divecomputer *dc; @@ -394,6 +406,8 @@ void save_one_dive(struct membuffer *b, struct dive *dive) /* Save the dive computer data */ for_each_dc(dive, dc) save_dc(b, dive, dc); + FOR_EACH_PICTURE(dive) + save_picture(b, picture); put_format(b, "\n"); }