From 4cce5df7e22575d5e37f99b15dbf283e2da53ea9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 2 Jan 2014 21:36:01 -0800 Subject: Fix imperial cylinder sizes in equipment tab The imperial cylinder sizes are not just in cubic feet: they are in cubic feet of gas at STP. So the imperial/metric difference is not just about converting blindly from liters to cubic feet, you also have to take the working pressure of the cylinder into account. This was broken by commit f9b7c5dfe9d0 ("Make units in cells consistant in CylindersModel"), because those poor sheltered Swedish people have never had to work with the wondrous imperial cylinder sizing, and think that units should make _sense_. Hah. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 0199c9989..ab501a2bd 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -111,11 +111,8 @@ QVariant CylindersModel::data(const QModelIndex& index, int role) const ret = QString(cyl->type.description); break; case SIZE: - // we can't use get_volume_string because the idiotic imperial tank - // sizes take working pressure into account... - if (cyl->type.size.mliter) { - ret = get_volume_string(cyl->type.size, TRUE); - } + if (cyl->type.size.mliter) + ret = get_volume_string(cyl->type.size, TRUE, cyl->type.workingpressure.mbar); break; case WORKINGPRESS: if (cyl->type.workingpressure.mbar) -- cgit v1.2.3-70-g09d2