mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 21:20:19 +00:00
288aff9dbb
We had two totally different usage cases for "get_volume_string()": one that did the obvious "show this volume as a string", and one that tried to show a cylinder size. The function used a magic third argument (the working pressure of the cylinder) to distinguish between the two cases, but it still got it wrong. A metric cylinder doesn't necessarily have a working pressure at all, and the size is a wet size in liters. We'd pass in zero as the working pressure, and if the volume units were set to cubic feet, the logic in "get_volume_string()" would happily convert the metric wet size into the wet size in cubic feet. But that's completely wrong. An imperial cylinder size simply isn't a wet size. If you don't have a working pressure, you cannot convert the cylinder size to cubic feet. End of story. So instead of having "get_volume_string()" have magical behavior depending on working pressure, and getting it wrong anyway, just make get_volume_string do a pure volume conversion, and create a whole new function for showing the size of a cylinder. Now, if the cylinder doesn't have a working pressure, we just show the metric size, even if the user had asked for cubic feet. [Dirk Hohndel: added call to translation functions for the units] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org> |
||
---|---|---|
.. | ||
subsurface-qt | ||
android.cpp | ||
checkcloudconnection.cpp | ||
checkcloudconnection.h | ||
cloudstorage.cpp | ||
cloudstorage.h | ||
CMakeLists.txt | ||
cochran.c | ||
cochran.h | ||
color.cpp | ||
color.h | ||
configuredivecomputer.cpp | ||
configuredivecomputer.h | ||
configuredivecomputerthreads.cpp | ||
configuredivecomputerthreads.h | ||
datatrak.c | ||
datatrak.h | ||
deco.c | ||
deco.h | ||
device.c | ||
device.h | ||
devicedetails.cpp | ||
devicedetails.h | ||
display.h | ||
dive.c | ||
dive.h | ||
divecomputer.cpp | ||
divecomputer.h | ||
divelist.c | ||
divelist.h | ||
divelogexportlogic.cpp | ||
divelogexportlogic.h | ||
divesite.c | ||
divesite.cpp | ||
divesite.h | ||
divesitehelpers.cpp | ||
divesitehelpers.h | ||
equipment.c | ||
exif.cpp | ||
exif.h | ||
file.c | ||
file.h | ||
gaspressures.c | ||
gaspressures.h | ||
gettext.h | ||
gettextfromc.cpp | ||
gettextfromc.h | ||
git-access.c | ||
git-access.h | ||
gpslocation.cpp | ||
gpslocation.h | ||
helpers.h | ||
imagedownloader.cpp | ||
imagedownloader.h | ||
isocialnetworkintegration.cpp | ||
isocialnetworkintegration.h | ||
libdivecomputer.c | ||
libdivecomputer.h | ||
linux.c | ||
liquivision.c | ||
load-git.c | ||
macos.c | ||
membuffer.c | ||
membuffer.h | ||
metrics.cpp | ||
metrics.h | ||
ostctools.c | ||
parse-xml.c | ||
planner.c | ||
planner.h | ||
pluginmanager.cpp | ||
pluginmanager.h | ||
pref.h | ||
prefs-macros.h | ||
profile.c | ||
profile.h | ||
qt-gui.h | ||
qt-init.cpp | ||
qthelper.cpp | ||
qthelper.h | ||
qthelperfromc.h | ||
qtserialbluetooth.cpp | ||
save-git.c | ||
save-html.c | ||
save-html.h | ||
save-xml.c | ||
serial_ftdi.c | ||
sha1.c | ||
sha1.h | ||
statistics.c | ||
statistics.h | ||
strndup.h | ||
strtod.c | ||
subsurfacestartup.c | ||
subsurfacestartup.h | ||
subsurfacesysinfo.cpp | ||
subsurfacesysinfo.h | ||
taxonomy.c | ||
taxonomy.h | ||
time.c | ||
uemis-downloader.c | ||
uemis.c | ||
uemis.h | ||
units.h | ||
version.c | ||
version.h | ||
webservice.h | ||
windows.c | ||
windowtitleupdate.cpp | ||
windowtitleupdate.h | ||
worldmap-options.h | ||
worldmap-save.c | ||
worldmap-save.h |