[PATCH] Gas was printed in permille, use gasname instead

Anton Lundin glance at acc.umu.se
Sun Jun 8 09:20:18 PDT 2014


After the switch to a central event decoder and just return gasmix from
that we printed things in permille, eg. EAN1000 and 180/550 which looks
kinda strange.
This fixes that by using gasname instead to give the gas a name.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 qt-ui/profile/diveeventitem.cpp | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp
index 87b57bf..0a468d0 100644
--- a/qt-ui/profile/diveeventitem.cpp
+++ b/qt-ui/profile/diveeventitem.cpp
@@ -83,16 +83,8 @@ void DiveEventItem::setupToolTipString()
 	if (value) {
 		if (type == SAMPLE_EVENT_GASCHANGE || type == SAMPLE_EVENT_GASCHANGE2) {
 			struct gasmix *g = get_gasmix_from_event(internalEvent);
-			int he = get_he(g);
-			int o2 = get_o2(g);
-
 			name += ": ";
-			if (he)
-				name += QString("%1/%2").arg(o2).arg(he);
-			else if (o2 == 21) // don't use is_air() as that assumes permille
-				name += tr("air");
-			else
-				name += QString(tr("EAN%1")).arg(o2);
+			name += gasname(g);
 		} else if (type == SAMPLE_EVENT_PO2 && name == "SP change") {
 			name += QString(":%1").arg((double)value / 1000);
 		} else {
-- 
1.9.1



More information about the subsurface mailing list