summaryrefslogtreecommitdiffstats
path: root/webservice.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-31 11:08:36 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-31 12:01:03 +1100
commit8843ee61560fb3c6a66b7ae9f10367f57eddb109 (patch)
tree3ee4060565c6510b0ed198676a0255b045256f74 /webservice.c
parent9099972c20a49a96a0abac2ff2c4b163b59c6883 (diff)
downloadsubsurface-8843ee61560fb3c6a66b7ae9f10367f57eddb109.tar.gz
Allow using two different tables to hold dives and gps locations
This only changes the infrastructure and actually loses functionality as it no longer does the simplistic "just treat the locations as dives and merge them". The new code that does something "smart" with the gps_location_table is yet to be written. But now we can use the XML parser to put the gps locations downloaded from the webservice into their own data structure. In the process I noticed that we never used the two delete functions in parse-xml.c and removed them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'webservice.c')
-rw-r--r--webservice.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/webservice.c b/webservice.c
index 243d9b5a0..9dde771e8 100644
--- a/webservice.c
+++ b/webservice.c
@@ -6,6 +6,8 @@
#include "dive.h"
#include "display-gtk.h"
+struct dive_table gps_location_table;
+
enum {
DD_STATUS_OK,
DD_STATUS_ERROR_CONNECT,
@@ -203,8 +205,9 @@ void webservice_download_dialog(void)
result = gtk_dialog_run(GTK_DIALOG(dialog));
if (result == GTK_RESPONSE_ACCEPT) {
/* apply download */
- parse_xml_buffer(_("Webservice"), state.xmldata, state.xmldata_len, NULL);
- report_dives(TRUE, FALSE);
+ parse_xml_buffer(_("Webservice"), state.xmldata, state.xmldata_len, &gps_location_table, NULL);
+ /* now merge the data in the gps_location table into the dive_table */
+ // TBD
/* store last entered uid in config */
subsurface_set_conf("webservice_uid", gtk_entry_get_text(GTK_ENTRY(uid)));
}