summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/CylinderObjectHelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/subsurface-qt/CylinderObjectHelper.cpp')
-rw-r--r--core/subsurface-qt/CylinderObjectHelper.cpp44
1 files changed, 12 insertions, 32 deletions
diff --git a/core/subsurface-qt/CylinderObjectHelper.cpp b/core/subsurface-qt/CylinderObjectHelper.cpp
index f2216af6f..f8386c402 100644
--- a/core/subsurface-qt/CylinderObjectHelper.cpp
+++ b/core/subsurface-qt/CylinderObjectHelper.cpp
@@ -3,36 +3,16 @@
#include "../qthelper.h"
static QString EMPTY_CYLINDER_STRING = QStringLiteral("");
-CylinderObjectHelper::CylinderObjectHelper(cylinder_t *cylinder) :
- m_cyl(cylinder) {
-}
-
-CylinderObjectHelper::~CylinderObjectHelper() {
-}
-
-QString CylinderObjectHelper::description() const {
- if (!m_cyl->type.description)
- return QString(EMPTY_CYLINDER_STRING);
- else
- return QString(m_cyl->type.description);
-}
-
-QString CylinderObjectHelper::size() const {
- return get_volume_string(m_cyl->type.size, true);
-}
-
-QString CylinderObjectHelper::workingPressure() const {
- return get_pressure_string(m_cyl->type.workingpressure, true);
-}
-
-QString CylinderObjectHelper::startPressure() const {
- return get_pressure_string(m_cyl->start, true);
-}
-
-QString CylinderObjectHelper::endPressure() const {
- return get_pressure_string(m_cyl->end, true);
-}
-
-QString CylinderObjectHelper::gasMix() const {
- return get_gas_string(m_cyl->gasmix);
+CylinderObjectHelper::CylinderObjectHelper(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);
}