summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/DiveObjectHelper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-13 08:19:04 +0200
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2019-09-14 13:20:59 +0200
commitf8c5c8bedf9c0af8f031da7fc74c516a40e9e1c6 (patch)
tree92c557ab1de0506e1e0a33bc2ab22738e17393e4 /core/subsurface-qt/DiveObjectHelper.cpp
parentbe763452adc110cfcc011322d989698d897dd6ed (diff)
downloadsubsurface-f8c5c8bedf9c0af8f031da7fc74c516a40e9e1c6.tar.gz
Mobile: Generate DiveObjectHelpers on the fly
Instead of keeping track of a list of DiveObjectHelpers, generate them on-the-fly in DiveListModel. Thus, there is less danger of model and core getting out of sync. On the flip-side, now the DiveListModel and the DiveListSortModel might get out of sync. 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.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp
index c19c03eb4..cb6cf6dd1 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -67,6 +67,16 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) :
{
}
+DiveObjectHelper::operator bool() const
+{
+ return !!m_dive;
+}
+
+bool DiveObjectHelper::operator!() const
+{
+ return !m_dive;
+}
+
int DiveObjectHelper::number() const
{
return m_dive->number;