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>
This commit is contained in:
Dirk Hohndel 2012-11-28 22:02:03 -07:00
parent 10fac7a6af
commit a79b74ed36
4 changed files with 19 additions and 96 deletions

12
uemis.c
View file

@ -199,16 +199,10 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
else
dive->salinity = 10000; /* grams per 10l fresh water */
/* this will allow us to find the last dive read so far from this computer */
dc->model = strdup("Uemis Zurich");
/*
* FIXME:
* - make the deive ID the first word of the SHA1 sum of the deviceid string
* - do we want to have a dive ID? Without one, we'll just use the dive date,
* which is likely fine.
*/
dc->deviceid = 0;
dc->diveid = 0;
dc->deviceid = *(uint32_t *)(data + 9);
dc->diveid = *(uint16_t *)(data + 7);
/* dive template in use:
0 = air