mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 22:33:24 +00:00
cleanup: remove obsolete logic in getFormattedCylinder()
getFormattedCylinder() is a helper function to format a list of cylinders. It had that weird logic that it would skip cylinders without description unless it is the first, which would instead be written as "unkown". The reason was the old statically sized cylinder array, where it wasn't clear if a cylinder was actually in use. This became obsolete when switching to a variable size cylinder array. Firstly, all cylinders in the array were added by the user. Secondly, we now also support dives without cylinders, i.e. the first cylinder is not any different from the rest. Thus, remove the logic and format any cylinder without description as being of type "unknown". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2c878ea6b6
commit
4d15f8ee33
1 changed files with 0 additions and 2 deletions
|
@ -35,8 +35,6 @@ static QString getFormattedCylinder(const struct dive *dive, int idx)
|
|||
{
|
||||
const cylinder_t *cyl = get_cylinder(dive, idx);
|
||||
const char *desc = cyl->type.description;
|
||||
if (!desc && idx > 0)
|
||||
return QString();
|
||||
QString fmt = desc ? QString(desc) : gettextFromC::tr("unknown");
|
||||
fmt += ", " + get_volume_string(cyl->type.size, true);
|
||||
fmt += ", " + get_pressure_string(cyl->type.workingpressure, true);
|
||||
|
|
Loading…
Add table
Reference in a new issue