mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Parser: remove webservice related code
Recently, the subsurface webservice was removed. Remove the corresponding code in the parser. This removes a static variable, which was used to generate unique dive-site ids. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9c6d24e50e
commit
ee0fc25cf3
3 changed files with 0 additions and 20 deletions
|
@ -1520,11 +1520,6 @@ static void uddf_importer(void)
|
|||
xml_parsing_units.temperature = KELVIN;
|
||||
}
|
||||
|
||||
static void subsurface_webservice(void)
|
||||
{
|
||||
import_source = SSRF_WS;
|
||||
}
|
||||
|
||||
/*
|
||||
* I'm sure this could be done as some fancy DTD rules.
|
||||
* It's just not worth the headache.
|
||||
|
@ -1557,7 +1552,6 @@ static struct nesting {
|
|||
/* Import type recognition */
|
||||
{ "Divinglog", DivingLog_importer },
|
||||
{ "uddf", uddf_importer },
|
||||
{ "output", subsurface_webservice },
|
||||
{ NULL, }
|
||||
};
|
||||
|
||||
|
|
13
core/parse.c
13
core/parse.c
|
@ -411,7 +411,6 @@ void utf8_string(char *buffer, void *_res)
|
|||
|
||||
void add_dive_site(char *ds_name, struct dive *dive)
|
||||
{
|
||||
static int suffix = 1;
|
||||
char *buffer = ds_name;
|
||||
char *to_free = NULL;
|
||||
int size = trimspace(buffer);
|
||||
|
@ -426,18 +425,6 @@ void add_dive_site(char *ds_name, struct dive *dive)
|
|||
if (!uuid) {
|
||||
// if the dive doesn't have a uuid, check if there's already a dive site by this name
|
||||
uuid = get_dive_site_uuid_by_name(buffer, &ds);
|
||||
if (uuid && import_source == SSRF_WS) {
|
||||
// when downloading GPS fixes from the Subsurface webservice we will often
|
||||
// get a lot of dives with identical names (the autogenerated fixes).
|
||||
// So in this case modify the name to make it unique
|
||||
int name_size = strlen(buffer) + 10; // 8 digits - enough for 100 million sites
|
||||
to_free = buffer = malloc(name_size);
|
||||
do {
|
||||
suffix++;
|
||||
snprintf(buffer, name_size, "%s %8d", ds_name, suffix);
|
||||
} while (get_dive_site_uuid_by_name(buffer, NULL) != 0);
|
||||
ds = NULL;
|
||||
}
|
||||
}
|
||||
if (ds) {
|
||||
// we have a uuid, let's hope there isn't a different name
|
||||
|
|
|
@ -46,7 +46,6 @@ enum import_source {
|
|||
LIBDIVECOMPUTER,
|
||||
DIVINGLOG,
|
||||
UDDF,
|
||||
SSRF_WS,
|
||||
} import_source;
|
||||
|
||||
/* the dive table holds the overall dive list; target table points at
|
||||
|
|
Loading…
Add table
Reference in a new issue