[PATCH 1/2] Use get_cylinder_index instead of get_gasidx

Anton Lundin glance at acc.umu.se
Wed Jul 16 23:55:02 PDT 2014


Replace get_gasmix_from_event and get_gasidx with get_cylinder_index.

get_cylinder_index actually knows about both types of gaschange events
and the difference between them.

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

diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp
index 201b489..b614e83 100644
--- a/qt-ui/profile/diveeventitem.cpp
+++ b/qt-ui/profile/diveeventitem.cpp
@@ -128,9 +128,8 @@ bool DiveEventItem::shouldBeHidden()
 	 * Don't bother showing them if they match the first gas already
 	 */
 	if (!strcmp(event->name, "gaschange") && !event->time.seconds) {
-		struct gasmix *mix = get_gasmix_from_event(event);
 		struct dive *dive = current_dive;
-		if (dive && get_gasidx(dive, mix) <= 0)
+		if (dive && get_cylinder_index(dive, event) == 0)
 			return true;
 	}
 	for (int i = 0; i < evn_used; i++) {
-- 
1.9.1



More information about the subsurface mailing list