diff options
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 9 |
1 files changed, 6 insertions, 3 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) { |