mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add the ability to set a nickname for a dive computer
We maintain a list of dive computers that we know about (by deviceid) and their nicknames in our config. If the user downloads dive from a dive computer that we haven't seen before, we give them the option to set a nickname for that dive computer. That nickname is displayed in the profile (and stored in the XML file, assuming it is not the same as the model). This implementation attempts to make sure that it correctly deals with utf8 nicknames. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
aba65736eb
commit
713a4fcff6
6 changed files with 158 additions and 2 deletions
|
@ -625,6 +625,8 @@ static void try_to_fill_dc(struct divecomputer *dc, const char *name, char *buf)
|
|||
return;
|
||||
if (MATCH(".model", utf8_string, &dc->model))
|
||||
return;
|
||||
if (MATCH(".nickname", utf8_string, &dc->nickname))
|
||||
return;
|
||||
if (MATCH(".deviceid", hex_value, &dc->deviceid))
|
||||
return;
|
||||
if (MATCH(".diveid", hex_value, &dc->diveid))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue