Add settings section to XML file format and store dive computer IDs

We only store the model/deviceid/nickname for those dive computers that
are mentioned in the XML file. This should make the XML files nicely
selfcontained.

This also changes the code to consistently use model & deviceid to
identify a dive computer. The deviceid is NOT guaranteed to be collision
free between different libdivecomputer backends...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-12-26 13:47:54 -08:00
parent 1bd6f72d31
commit e726c9d65c
5 changed files with 139 additions and 39 deletions

5
dive.h
View file

@ -528,8 +528,9 @@ extern void dive_list_update_dives(void);
extern void flush_divelist(struct dive *dive);
extern void set_dc_nickname(struct dive *dive);
extern const char *get_dc_nickname(uint32_t deviceid);
extern void remember_dc(uint32_t deviceid, const char *model, const char *nickname, gboolean change_conf);
extern const char *get_dc_nickname(const char *model, uint32_t deviceid);
extern void remember_dc(const char *model, uint32_t deviceid, const char *nickname, gboolean change_conf);
extern void add_dc_to_string(char **dc_xml, struct divecomputer *dc);
#define DIVE_ERROR_PARSE 1