summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-08 20:51:13 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-08 21:00:56 -0700
commitbbe62f756a0c0fbfae58c40d9e1605382c0f65a6 (patch)
tree058b2fcb72bdab56ab1ddee6c4edf1c259c08021 /qt-ui
parent11380a5deb071b647e10dbd51e64340e50da801d (diff)
downloadsubsurface-bbe62f756a0c0fbfae58c40d9e1605382c0f65a6.tar.gz
Change character for liter in SAC values as well
And fix the bug that in the info overlay SAC was always given in metric values. And try to reduce the number of places in which we calculate the unit conversions... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/models.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 496c32cdb..09b737179 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1258,11 +1258,10 @@ QString DiveItem::displaySac() const
{
QString str;
struct dive *dive = get_dive_by_uniq_id(diveId);
- if (get_units()->volume == units::LITER)
- str = QString::number(dive->sac / 1000.0, 'f', 1).append(tr(" l/min"));
- else
- str = QString::number(ml_to_cuft(dive->sac), 'f', 2).append(tr(" cuft/min"));
- return str;
+ const char *unit;
+ int decimal;
+ double value = get_volume_units(dive->sac, &decimal, &unit);
+ return QString::number(value, 'f', decimal).append(unit).append(tr("/min"));
}
QString DiveItem::displayWeight() const