Don't list gases that weren't used in profile print

If the divecomputer adds additional, unused cylinders to the dive, they
would be listed in the profile based printouts. Given that the field is
named "Gas used" that seems wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-08-06 07:08:31 -07:00
parent 71bed5022c
commit eb63ccfed5

View file

@ -1968,6 +1968,8 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
int added = 0; int added = 0;
QString gas, gases; QString gas, gases;
for (int i = 0; i < MAX_CYLINDERS; i++) { for (int i = 0; i < MAX_CYLINDERS; i++) {
if (!is_cylinder_used(dive, i))
continue;
gas = dive->cylinder[i].type.description; gas = dive->cylinder[i].type.description;
gas += QString(!gas.isEmpty() ? " " : "") + gasname(&dive->cylinder[i].gasmix); gas += QString(!gas.isEmpty() ? " " : "") + gasname(&dive->cylinder[i].gasmix);
// if has a description and if such gas is not already present // if has a description and if such gas is not already present