summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/profile.c b/profile.c
index 4244b47c7..566b64fc0 100644
--- a/profile.c
+++ b/profile.c
@@ -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) {