Make depth conversion work for negative depths

This is needed in the altitude pressure conversion as there
negative altitudes are possible (for diving in the netherlands
or the Dead Sea).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2017-03-10 07:22:31 +01:00 committed by Dirk Hohndel
parent af96ec5d04
commit 295b1b78d8
5 changed files with 13 additions and 9 deletions

View file

@ -288,7 +288,7 @@ bool DivePlannerPointsModel::setData(const QModelIndex &index, const QVariant &v
switch (index.column()) {
case DEPTH:
if (value.toInt() >= 0) {
p.depth = units_to_depth(value.toInt());
p.depth = units_to_depth(value.toInt()).mm;
if (updateMaxDepth())
CylindersModel::instance()->updateBestMixes();
}