summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/DiveObjectHelper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-22 19:40:42 +0200
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2019-09-14 13:20:59 +0200
commit718c07c1a864ae307306fc54d3a8ba38e30bf759 (patch)
treed4850c0243ff396be8232673473c48f610228f04 /core/subsurface-qt/DiveObjectHelper.cpp
parent6a9df3bba3021b95f354c0590c79a458dbeca45b (diff)
downloadsubsurface-718c07c1a864ae307306fc54d3a8ba38e30bf759.tar.gz
Grantlee: split out grantlee-only property from DiveObjectHelper
The cylindersObject list was only used by grantlee but not by the mobile code. Since it is quite heavy, split it out and thus don't generate it for every dive on mobile. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/subsurface-qt/DiveObjectHelper.cpp')
-rw-r--r--core/subsurface-qt/DiveObjectHelper.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp
index ec62a9fec..9e4ff47bb 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -238,7 +238,6 @@ DiveObjectHelper::DiveObjectHelper(const struct dive *d) :
singleWeight(d->weightsystems.nr <= 1),
suit(d->suit ? d->suit : QString()),
cylinders(formatCylinders(d)),
- cylinderObjects(makeCylinderObjects(d)),
maxcns(d->maxcns),
otu(d->otu),
sumWeight(get_weight_string(weight_t { total_weight(d) }, true)),
@@ -249,6 +248,16 @@ DiveObjectHelper::DiveObjectHelper(const struct dive *d) :
{
}
+DiveObjectHelperGrantlee::DiveObjectHelperGrantlee()
+{
+}
+
+DiveObjectHelperGrantlee::DiveObjectHelperGrantlee(const struct dive *d) :
+ DiveObjectHelper(d),
+ cylinderObjects(makeCylinderObjects(d))
+{
+}
+
QString DiveObjectHelper::date() const
{
QDateTime localTime = QDateTime::fromMSecsSinceEpoch(1000 * timestamp, Qt::UTC);