From 1d8662006cbb5edae941315e30ede381c23a817b Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Thu, 2 Feb 2017 20:29:44 +0100 Subject: In statistics, ignore gas use of planned dives When merged with real dives, those would double count otherwise. Signed-off-by: Robert C. Helling --- qt-models/cylindermodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qt-models') diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index fe63cf6f2..d5220a56e 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -451,7 +451,7 @@ void CylindersModel::updateDive() for (int i = 0; i < MAX_CYLINDERS; i++) { if (!cylinder_none(&displayed_dive.cylinder[i]) && (prefs.display_unused_tanks || - is_cylinder_used(&displayed_dive, i) || + is_cylinder_used(&displayed_dive, i, false) || displayed_dive.cylinder[i].manually_added)) rows = i + 1; } @@ -468,7 +468,7 @@ void CylindersModel::copyFromDive(dive *d) rows = 0; for (int i = 0; i < MAX_CYLINDERS; i++) { if (!cylinder_none(&d->cylinder[i]) && - (is_cylinder_used(d, i) || prefs.display_unused_tanks)) { + (is_cylinder_used(d, i, false) || prefs.display_unused_tanks)) { rows = i + 1; } } @@ -517,7 +517,7 @@ void CylindersModel::remove(const QModelIndex &index) ((DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING && DivePlannerPointsModel::instance()->tankInUse(index.row())) || (DivePlannerPointsModel::instance()->currentMode() == DivePlannerPointsModel::NOTHING && - is_cylinder_used(&displayed_dive, index.row())))) { + is_cylinder_used(&displayed_dive, index.row(), false)))) { emit warningMessage(TITLE_OR_TEXT( tr("Cylinder cannot be removed"), tr("This gas is in use. Only cylinders that are not used in the dive can be removed."))); -- cgit v1.2.3-70-g09d2