aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 12:07:29 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 12:07:29 -0700
commit1a040134538b7733f3088ea34f101cfedecc2c64 (patch)
tree53eb0fc9dd65f3e75fb886075cc5b952b3800157 /qt-ui/profile
parentfb4d9b34f87f71b072bccb36633d7247b9d9dd9d (diff)
downloadsubsurface-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.cpp5
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)