diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-12-15 15:43:06 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-12-17 13:03:56 -0800 |
commit | cc5ebd741486c3231b50974959de2f5d842b8fa5 (patch) | |
tree | 8ef11506ff3f65956bc32025c8cf6438305ea822 /desktop-widgets/templatelayout.cpp | |
parent | ae182c386b0b1b58ab25fc1fbc18c3618062e57f (diff) | |
download | subsurface-cc5ebd741486c3231b50974959de2f5d842b8fa5.tar.gz |
printing: remove CylinderObjectHelper
With the removal of grantlee, this became pointless glue
code. Call the formatting functions directly.
Since the printing code was the only user of CylinderObjectHelper,
remove the whole thing.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/templatelayout.cpp')
-rw-r--r-- | desktop-widgets/templatelayout.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/desktop-widgets/templatelayout.cpp b/desktop-widgets/templatelayout.cpp index 025c1c31d..94cf322f0 100644 --- a/desktop-widgets/templatelayout.cpp +++ b/desktop-widgets/templatelayout.cpp @@ -10,7 +10,6 @@ #include "core/selection.h" #include "core/qthelper.h" #include "core/string-format.h" -#include "core/subsurface-qt/cylinderobjecthelper.h" // TODO: remove once grantlee supports Q_GADGET objects QList<QString> grantlee_templates, grantlee_statistics_templates; @@ -499,19 +498,19 @@ QVariant TemplateLayout::getValue(QString list, QString property, const State &s } else if (list == "cylinderObjects") { if (!state.currentCylinderObject) return QVariant(); - const CylinderObjectHelper object(*state.currentCylinderObject); + const cylinder_t *cylinder = *state.currentCylinderObject; if (property == "description") { - return object.description; + return cylinder->type.description; } else if (property == "size") { - return object.size; + return get_volume_string(cylinder->type.size, true); } else if (property == "workingPressure") { - return object.workingPressure; + return get_pressure_string(cylinder->type.workingpressure, true); } else if (property == "startPressure") { - return object.startPressure; + return get_pressure_string(cylinder->start, true); } else if (property == "endPressure") { - return object.endPressure; + return get_pressure_string(cylinder->end, true); } else if (property == "gasMix") { - return object.gasMix; + return get_gas_string(cylinder->gasmix); } } else if (list == "dives") { if (!state.currentDive) |