From 2a977a0fcde76e6d321a4ae66706f7c874dc8fe3 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Wed, 21 Oct 2015 14:49:04 +0200 Subject: Set a cylinder if the default cylinder is bogus Apparently, it can happen that the default cylinder is not set even though same_string(prefs.default_cylinder, "") is false. Then we fall back to the 11.1l air cylinder. This should silence a warnign about "Too many gases". Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-models/diveplannermodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-models/diveplannermodel.cpp') diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 6556db50b..70a7c6f62 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -128,7 +128,8 @@ void DivePlannerPointsModel::setupCylinders() } if (!same_string(prefs.default_cylinder, "")) { fill_default_cylinder(&displayed_dive.cylinder[0]); - } else { + } + if (cylinder_none(&displayed_dive.cylinder[0])) { // roughly an AL80 displayed_dive.cylinder[0].type.description = strdup(tr("unknown").toUtf8().constData()); displayed_dive.cylinder[0].type.size.mliter = 11100; -- cgit v1.2.3-70-g09d2