summaryrefslogtreecommitdiffstats
path: root/qt-models/divelistmodel.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-19 22:12:50 -0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-20 16:08:55 -0400
commit613a3112d27e2d40c3a4eeb7fb061f4739279157 (patch)
tree1cf0ba01a5c9af758897b7d5919e21822c2dfe94 /qt-models/divelistmodel.h
parent09c7115e2192c30ee86007b1dcdec04134813751 (diff)
downloadsubsurface-613a3112d27e2d40c3a4eeb7fb061f4739279157.tar.gz
Mobile: get dive details directly from the model
By getting a DiveObjectHelper and then dereferencing that we ended up creating hundres and hundreds of these objects, only to immediately destroy them after using a tiny part of the data. Instead make those data available directly from the model, without having to create a DiveObjectHelper forst. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/divelistmodel.h')
-rw-r--r--qt-models/divelistmodel.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h
index 90cc51966..2f8985235 100644
--- a/qt-models/divelistmodel.h
+++ b/qt-models/divelistmodel.h
@@ -29,6 +29,15 @@ private:
void updateFilterState();
};
+QString formatSac(const dive *d);
+QString formatNotes(const dive *d);
+QString format_gps_decimal(const dive *d);
+QStringList formatGetCylinder(const dive *d);
+QStringList getStartPressure(const dive *d);
+QStringList getEndPressure(const dive *d);
+QStringList getFirstGas(const dive *d);
+
+
class DiveListModel : public QAbstractListModel
{
Q_OBJECT
@@ -42,7 +51,28 @@ public:
IdRole,
NumberRole,
LocationRole,
+ DepthRole,
+ DurationRole,
DepthDurationRole,
+ RatingRole,
+ VizRole,
+ SuitRole,
+ AirTempRole,
+ WaterTempRole,
+ SacRole,
+ SumWeightRole,
+ DiveMasterRole,
+ BuddyRole,
+ NotesRole,
+ GpsDecimalRole,
+ GpsRole,
+ NoDiveRole,
+ DiveSiteRole,
+ CylinderRole,
+ SingleWeightRole,
+ StartPressureRole,
+ EndPressureRole,
+ FirstGasRole,
};
static DiveListModel *instance();