summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-28 22:02:03 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-28 22:02:03 -0700
commita79b74ed36f6a52db947ff24761a3fd331c75cdc (patch)
treec5986baa8d28be329ae8396d31f2e8d15739ccac /gtk-gui.c
parent10fac7a6af7e95b45029372f32ce544c705f6887 (diff)
downloadsubsurface-a79b74ed36f6a52db947ff24761a3fd331c75cdc.tar.gz
Track Uemis last dive downloaded on a per data-file basis
Actually, it's even better than that. Thanks to the new divecomputer datastructure we can now simply look up in the dive_table which dives have been downloaded from this specific Uemis SDA. This patch removes the old gconf based code - which leads to one unfortunate problem: the first time a Uemis SDA owner runs this version of Subsurface against their data file ALL dives will be downloaded again (which may not be a bad thing as we have improved a few other details of Uemis support so now they get their deco information, surface pressure and other data that we have started to support since 2.1). Still, this is not ideal. But I didn't want to keep the legacy code around since this new solution is so much cleaner. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index dc9620914..81f93ca1e 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -42,7 +42,6 @@ partial_pressure_graphs_t partial_pressure_graphs = { FALSE, FALSE, FALSE, 1.6,
static const char *default_dive_computer_vendor;
static const char *default_dive_computer_product;
static const char *default_dive_computer_device;
-static char *uemis_max_dive_data;
static gboolean force_download;
static gboolean prefer_downloaded;
@@ -87,12 +86,6 @@ static void set_default_dive_computer_device(const char *name)
subsurface_set_conf("dive_computer_device", PREF_STRING, name);
}
-static void set_uemis_last_dive(char *data)
-{
- uemis_max_dive_data = data;
- subsurface_set_conf("uemis_max_dive_data", PREF_STRING, data);
-}
-
void repaint_dive(void)
{
update_dive(current_dive);
@@ -1157,12 +1150,6 @@ void init_ui(int *argcp, char ***argvp)
default_dive_computer_vendor = subsurface_get_conf("dive_computer_vendor", PREF_STRING);
default_dive_computer_product = subsurface_get_conf("dive_computer_product", PREF_STRING);
default_dive_computer_device = subsurface_get_conf("dive_computer_device", PREF_STRING);
- conf_value = subsurface_get_conf("uemis_max_dive_data", PREF_STRING);
- if (!conf_value)
- uemis_max_dive_data = strdup("");
- else
- uemis_max_dive_data = strdup(conf_value);
- free((char *)conf_value);
error_info_bar = NULL;
win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_set_application_name ("subsurface");
@@ -1662,16 +1649,12 @@ static GError *setup_uemis_import(device_data_t *data)
GError *error = NULL;
char *buf = NULL;
- error = uemis_download(data->devname, &uemis_max_dive_data, &buf, &data->progress, data->dialog, data->force_download);
+ error = uemis_download(data->devname, &buf, &data->progress, data->dialog, data->force_download);
if (buf && strlen(buf) > 1) {
#if UEMIS_DEBUG > 3
fprintf(debugfile, "xml buffer \"%s\"\n\n", buf);
#endif
parse_xml_buffer("Uemis Download", buf, strlen(buf), TRUE, &error);
- set_uemis_last_dive(uemis_max_dive_data);
-#if UEMIS_DEBUG > 2
- fprintf(debugfile, "uemis_max_dive_data: %s\n", uemis_max_dive_data);
-#endif
mark_divelist_changed(TRUE);
}
return error;