diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2017-02-18 11:47:18 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-02-18 10:48:33 -0800 |
commit | 4375a875984a2c3bb640d168eb24de52954a13b1 (patch) | |
tree | 0e39d33a05a434e7bdbd59c8489c8f7afe1c479b /desktop-widgets/subsurfacewebservices.cpp | |
parent | 0cf4104dc60134f207a60906e83311af986e0ada (diff) | |
download | subsurface-4375a875984a2c3bb640d168eb24de52954a13b1.tar.gz |
Include geolocation info on export XML (divelogs.de)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'desktop-widgets/subsurfacewebservices.cpp')
-rw-r--r-- | desktop-widgets/subsurfacewebservices.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index 15a14965d..dd5d0943f 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -216,7 +216,19 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile, put_degrees(&mb, ds->latitude, " gps='", " "); put_degrees(&mb, ds->longitude, "", "'"); } - put_format(&mb, "/>\n</divesites>\n"); + put_format(&mb, ">\n"); + if (ds->taxonomy.nr) { + for (int j = 0; j < ds->taxonomy.nr; j++) { + struct taxonomy *t = &ds->taxonomy.category[j]; + if (t->category != TC_NONE && t->category == prefs.geocoding.category[j] && t->value) { + put_format(&mb, " <geo cat='%d'", t->category); + put_format(&mb, " origin='%d' value='", t->origin); + put_quoted(&mb, t->value, 1, 0); + put_format(&mb, "'/>\n"); + } + } + } + put_format(&mb, "</site>\n</divesites>\n"); } save_one_dive_to_mb(&mb, dive); |