From 23973e8abdfb1354de9920cc1c5896a4fc84d25b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 11 Jan 2014 21:57:06 +0700 Subject: Don't show tanks that aren't used during a dive Some dive computers will always download all tanks that they store, not just the ones used in a dive. Most people only want to see the tanks that they actually used during the dive (and for the others there's an option to go back to the old behavior, just in case). All this is only in memory / during runtime. If the dive computer provided the extra data we will not throw it away. Fixes #373 Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-ui/models.cpp') diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 4debafd9a..1e22f7da0 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -301,7 +301,8 @@ void CylindersModel::setDive(dive* d) return; rows = 0; for(int i = 0; i < MAX_CYLINDERS; i++) { - if (!cylinder_none(&d->cylinder[i])) { + if (!cylinder_none(&d->cylinder[i]) && + (prefs.display_unused_tanks || d->cylinder[i].used)) { rows = i+1; } } -- cgit v1.2.3-70-g09d2