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 --- core/subsurface-qt/cylinderobjecthelper.cpp | 18 ------------------ core/subsurface-qt/cylinderobjecthelper.h | 29 ----------------------------- core/subsurface-qt/diveobjecthelper.h | 2 +- 3 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 core/subsurface-qt/cylinderobjecthelper.cpp delete mode 100644 core/subsurface-qt/cylinderobjecthelper.h (limited to 'core/subsurface-qt') diff --git a/core/subsurface-qt/cylinderobjecthelper.cpp b/core/subsurface-qt/cylinderobjecthelper.cpp deleted file mode 100644 index 897746952..000000000 --- a/core/subsurface-qt/cylinderobjecthelper.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "cylinderobjecthelper.h" -#include "../qthelper.h" - -static QString EMPTY_CYLINDER_STRING = QStringLiteral(""); -CylinderObjectHelper::CylinderObjectHelper(const cylinder_t *cylinder) -{ - if (!cylinder) - return; - - description = cylinder->type.description ? cylinder->type.description: - EMPTY_CYLINDER_STRING; - size = get_volume_string(cylinder->type.size, true); - workingPressure = get_pressure_string(cylinder->type.workingpressure, true); - startPressure = get_pressure_string(cylinder->start, true); - endPressure = get_pressure_string(cylinder->end, true); - gasMix = get_gas_string(cylinder->gasmix); -} diff --git a/core/subsurface-qt/cylinderobjecthelper.h b/core/subsurface-qt/cylinderobjecthelper.h deleted file mode 100644 index e1e2490e4..000000000 --- a/core/subsurface-qt/cylinderobjecthelper.h +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#ifndef CYLINDER_QOBJECT_H -#define CYLINDER_QOBJECT_H - -#include "../equipment.h" -#include -#include - -class CylinderObjectHelper { - Q_GADGET - Q_PROPERTY(QString description MEMBER description CONSTANT) - Q_PROPERTY(QString size MEMBER size CONSTANT) - Q_PROPERTY(QString workingPressure MEMBER workingPressure CONSTANT) - Q_PROPERTY(QString startPressure MEMBER startPressure CONSTANT) - Q_PROPERTY(QString endPressure MEMBER endPressure CONSTANT) - Q_PROPERTY(QString gasMix MEMBER gasMix CONSTANT) -public: - CylinderObjectHelper(const cylinder_t *cylinder = NULL); - QString description; - QString size; - QString workingPressure; - QString startPressure; - QString endPressure; - QString gasMix; -}; - -Q_DECLARE_METATYPE(CylinderObjectHelper) - -#endif diff --git a/core/subsurface-qt/diveobjecthelper.h b/core/subsurface-qt/diveobjecthelper.h index b76a9930f..30dee6bf7 100644 --- a/core/subsurface-qt/diveobjecthelper.h +++ b/core/subsurface-qt/diveobjecthelper.h @@ -2,7 +2,7 @@ #ifndef DIVE_QOBJECT_H #define DIVE_QOBJECT_H -#include "cylinderobjecthelper.h" +#include "core/units.h" #include #include #include -- cgit v1.2.3-70-g09d2