mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remove nickname from divecomputer data structure
Having it there with the model information seemed to make sense but on second thought it's the wrong spot to keep that information, especially since we were storing it in the XML file in every single dive. This change removes the nickname member from the divecomputer and makes the rest of the code reasonably self consistent. It does not add much of the new code for the new design to handle nicknames. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
eb3e879030
commit
8d2abc05f6
6 changed files with 21 additions and 26 deletions
|
|
@ -1796,6 +1796,7 @@ void plot(struct graphics_context *gc, struct dive *dive, scale_mode_t scale)
|
|||
struct plot_info *pi;
|
||||
struct divecomputer *dc = &dive->dc;
|
||||
cairo_rectangle_t *drawing_area = &gc->drawing_area;
|
||||
const char *nickname;
|
||||
|
||||
plot_set_scale(scale);
|
||||
|
||||
|
|
@ -1878,10 +1879,12 @@ void plot(struct graphics_context *gc, struct dive *dive, scale_mode_t scale)
|
|||
cairo_stroke(gc->cr);
|
||||
|
||||
/* Put the dive computer name in the lower left corner */
|
||||
if (dc->nickname || dc->model) {
|
||||
nickname = get_dc_nickname(dc->deviceid);
|
||||
if (!nickname || *nickname == '\0')
|
||||
nickname = dc->model;
|
||||
if (nickname) {
|
||||
static const text_render_options_t computer = {10, TIME_TEXT, LEFT, MIDDLE};
|
||||
plot_text(gc, &computer, 0, 1, "%s",
|
||||
dc->nickname && *dc->nickname ? dc->nickname : dc->model);
|
||||
plot_text(gc, &computer, 0, 1, "%s", nickname);
|
||||
}
|
||||
|
||||
if (PP_GRAPHS_ENABLED) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue