subsurface/qt-models
Linus Torvalds 2fa66f7ab1 Tweak the "display_unused_tanks" preferences logic
This is really unrelated to my recent "multiple gas pressures" work, but
the test case from Gaetan Bisson showed that the logic for which
cylinders to show in the equipment tab was less than optimal.

We basically used to show only cylinders that were actively used, unless
you had the "display_unused_tanks" preference option set.  That comes
from some dive computers reporting a *lot* of cylinders that the diver
really doesn't even have with him on the dive.  And showing those extra
dummy cylinders gets pretty annoying after a time, which is why we
default to not showing unused tanks.

However, in Gaetan's case, he had a total of four cylinders on the dive:
the O2 and diluent bottle for the rebreather dive, and then bailout
bottles (both air and deco).  And while the bailout bottles weren't
actually used, Gaetan had actually filled in all the pressure details
etc for them, and so you'd really expect them to show up.  These were
*not* just some extraneous default cylinder filled in by an over-eager
dive computer.

But because the bailout wasn't used, the manual pressures at the end
were the same as at the beginning, and the "unused cylinder" logic
triggered anyway.

So tweak the logic a bit, and say that you show cylinder equipment not
only if it has been used on the dive, but also if it has any pressure
information for it.

So the o nly cylinders we don't show are the ones that really have no
interesting information at all, except for possibly the cylinder tank
type itself (which is exactly what the over-eager dive computer case
might fill in, usually in the form of a default cylinder type).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-30 21:28:38 -07:00
..
cleanertablemodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
cleanertablemodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
CMakeLists.txt qt-models/cmake: build maplocationmodel.cpp 2017-07-28 07:31:11 -07:00
completionmodels.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
completionmodels.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
cylindermodel.cpp Tweak the "display_unused_tanks" preferences logic 2017-07-30 21:28:38 -07:00
cylindermodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputerextradatamodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputerextradatamodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputermodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputermodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
diveimportedmodel.cpp DiveImportedModel: be consistent with last = -1 2017-07-09 16:04:31 -07:00
diveimportedmodel.h QML UI: clear the previous list when downloading 2017-06-16 01:22:44 -07:00
divelistmodel.cpp QML UI: add downloaded dives to dive list 2017-05-28 11:54:33 -07:00
divelistmodel.h QML UI: add downloaded dives to dive list 2017-05-28 11:54:33 -07:00
divelocationmodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divelocationmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divepicturemodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divepicturemodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
diveplannermodel.cpp Adopt planner state caching to new struct 2017-05-26 15:44:36 -07:00
diveplannermodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
diveplotdatamodel.cpp Profile support for multiple concurrent pressure sensors 2017-07-27 14:45:58 -07:00
diveplotdatamodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divesitepicturesmodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divesitepicturesmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divetripmodel.cpp Creation of dive duration string and surface interval string 2017-05-26 15:50:52 -07:00
divetripmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
filtermodels.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
filtermodels.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
gpslistmodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
gpslistmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
maplocationmodel.cpp Switch new files to unix line endings 2017-07-28 22:01:36 -07:00
maplocationmodel.h Map: mark function as override 2017-07-28 22:03:22 -07:00
messagehandlermodel.cpp Android: write appLog to file 2017-07-09 17:40:29 -07:00
messagehandlermodel.h Make message handler write to console as well 2017-06-11 13:55:41 -07:00
models.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
models.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
ssrfsortfilterproxymodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
ssrfsortfilterproxymodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
tankinfomodel.cpp tankinfomodel.cpp: clamp row index to [0 - MAX_TANK_INFO] 2017-06-15 14:48:49 -07:00
tankinfomodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
treemodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
treemodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weightmodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weightmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weigthsysteminfomodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weigthsysteminfomodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
yearlystatisticsmodel.cpp Creation of dive duration string and surface interval string 2017-05-26 15:50:52 -07:00
yearlystatisticsmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00