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 <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2015-10-21 14:49:04 +02:00 committed by Dirk Hohndel
parent 6495b629fe
commit 2a977a0fcd

View file

@ -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;