From a0aaadd50ba63ee4b15838564e6d919d41a3af40 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 20 Jul 2016 15:27:59 +0900 Subject: Add support for SAMPLE_EVENT_STRING event type Instead of having fixed numbers and trying to translate them into strings, a dive computer could just give us the string directly. Like the new EON Steel backend does. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- core/libdivecomputer.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/libdivecomputer.c') diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index 70917cf53..5ba445390 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -235,6 +235,10 @@ static void handle_event(struct divecomputer *dc, struct sample *sample, dc_samp name = QT_TRANSLATE_NOOP("gettextFromC", "invalid event number"); if (type < nr_events) name = events[type]; +#ifdef SAMPLE_EVENT_STRING + if (type == SAMPLE_EVENT_STRING) + name = value.event.name; +#endif time = value.event.time; if (sample) -- cgit v1.2.3-70-g09d2