summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-09-06 21:40:15 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-07 07:24:32 -0700
commit12a60cf9e63450228090592fae3c99069f131ae6 (patch)
tree670bde32c8fd8dbae37802f7e0c8eb350a8b31ea /qt-ui
parent5430eec99d0562733001e2603d687fa0d54dd06e (diff)
downloadsubsurface-12a60cf9e63450228090592fae3c99069f131ae6.tar.gz
Include dive site on divelogs export
Due to the new dive site management, we need to include this information before transforming the XML to divelogs.de format. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/subsurfacewebservices.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 128e199c3..1722da4ce 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -192,7 +192,25 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
continue;
/* make sure the buffer is empty and add the dive */
mb.len = 0;
+
+ struct dive_site *ds = get_dive_site_by_uuid(dive->dive_site_uuid);
+
+ if (ds) {
+ put_format(&mb, "<divelog><divesites><site uuid='%8x' name='", dive->dive_site_uuid);
+ put_quoted(&mb, ds->name, 1, 0);
+ put_format(&mb, "'");
+ if (ds->latitude.udeg || ds->longitude.udeg) {
+ put_degrees(&mb, ds->latitude, " gps='", " ");
+ put_degrees(&mb, ds->longitude, "", "'");
+ }
+ put_format(&mb, "/>\n</divesites>\n");
+ }
+
save_one_dive_to_mb(&mb, dive);
+
+ if (ds) {
+ put_format(&mb, "</divelog>\n");
+ }
membuf = mb_cstring(&mb);
streamsize = strlen(membuf);
/*