diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-10-18 23:42:17 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-24 09:51:37 -0700 |
commit | 8c65558b5c432c1d0e9c6af5939faa56ffecf51a (patch) | |
tree | b7ded4867685f70849d687d465c1653d3955b499 /core/parse-xml.c | |
parent | 255f561afffb26bae5c4de0c5fe2d60effb41103 (diff) | |
download | subsurface-8c65558b5c432c1d0e9c6af5939faa56ffecf51a.tar.gz |
devices: create device nodes in parsers
So far, we added a non-global device table to the parser states.
Now, create device nodes in that table instead of in the global
table. Thus, on undo of dive-import, the new device nodes will
be removed.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/parse-xml.c')
-rw-r--r-- | core/parse-xml.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c index b5b66c181..b50a7b582 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -830,7 +830,8 @@ static void try_to_fill_dc(struct divecomputer *dc, const char *name, char *buf, if (MATCH("model", utf8_string, &dc->model)) return; if (MATCH("deviceid", hex_value, &deviceid)) { - set_dc_deviceid(dc, deviceid, &device_table); + set_dc_deviceid(dc, deviceid, &device_table); // prefer already known serial/firmware over those from the loaded log + set_dc_deviceid(dc, deviceid, state->devices); return; } if (MATCH("diveid", hex_value, &dc->diveid)) |