From cc5ebd741486c3231b50974959de2f5d842b8fa5 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 15 Dec 2020 15:43:06 +0100 Subject: 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 --- desktop-widgets/templatelayout.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'desktop-widgets/templatelayout.cpp') 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 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) -- cgit v1.2.3-70-g09d2