diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-06-01 12:07:29 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-01 12:07:29 -0700 |
commit | 1a040134538b7733f3088ea34f101cfedecc2c64 (patch) | |
tree | 53eb0fc9dd65f3e75fb886075cc5b952b3800157 /qt-ui/profile | |
parent | fb4d9b34f87f71b072bccb36633d7247b9d9dd9d (diff) | |
download | subsurface-1a040134538b7733f3088ea34f101cfedecc2c64.tar.gz |
Encapsulate the horrid gas encoding in gas change events
We should never pass permille values around as integers. And we shouldn't
have to decode the stupid value in more than one place.
This doesn't tackle all the places where we access O2 and He "too early"
and should instead keep passing around a gaxmix. But it's a first step.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/diveeventitem.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp index 873c6abbe..87b57bfab 100644 --- a/qt-ui/profile/diveeventitem.cpp +++ b/qt-ui/profile/diveeventitem.cpp @@ -82,8 +82,9 @@ void DiveEventItem::setupToolTipString() int type = internalEvent->type; if (value) { if (type == SAMPLE_EVENT_GASCHANGE || type == SAMPLE_EVENT_GASCHANGE2) { - int he = value >> 16; - int o2 = value & 0xffff; + struct gasmix *g = get_gasmix_from_event(internalEvent); + int he = get_he(g); + int o2 = get_o2(g); name += ": "; if (he) |