diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-20 15:27:59 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-07-21 20:00:04 +0900 |
commit | a0aaadd50ba63ee4b15838564e6d919d41a3af40 (patch) | |
tree | e9c8443778dd9ec9affbe6ff9593b47592e643c3 /core/libdivecomputer.c | |
parent | c27ad52be4fd81eb77491e5d85addd1c907cc32d (diff) | |
download | subsurface-a0aaadd50ba63ee4b15838564e6d919d41a3af40.tar.gz |
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 <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/libdivecomputer.c')
-rw-r--r-- | core/libdivecomputer.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) |