From f8c5c8bedf9c0af8f031da7fc74c516a40e9e1c6 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 13 Aug 2019 08:19:04 +0200 Subject: 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 --- core/subsurface-qt/DiveObjectHelper.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/subsurface-qt/DiveObjectHelper.h') diff --git a/core/subsurface-qt/DiveObjectHelper.h b/core/subsurface-qt/DiveObjectHelper.h index 7071c1580..674386e56 100644 --- a/core/subsurface-qt/DiveObjectHelper.h +++ b/core/subsurface-qt/DiveObjectHelper.h @@ -50,6 +50,8 @@ class DiveObjectHelper { public: DiveObjectHelper(); // This is only to be used by Qt's metatype system! DiveObjectHelper(struct dive *dive); + operator bool() const; // Returns false if this is an invalid default-generated object + bool operator!() const; // Returns true if this is an invalid default-generated object int number() const; int id() const; struct dive *getDive() const; -- cgit v1.2.3-70-g09d2