diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-25 08:02:06 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-29 00:09:31 +0000 |
commit | b9b1b3146b3a0a05efcb11c50a953f3e8f2e023c (patch) | |
tree | a40397ddd9d370deb5ae66920d0bf2e98bf27868 /desktop-widgets/locationinformation.h | |
parent | 6f98dca26e342dff90c5dba81bf81cbeab5f6e63 (diff) | |
download | subsurface-b9b1b3146b3a0a05efcb11c50a953f3e8f2e023c.tar.gz |
Dive site: remove UUIDs from LocationInformationModel
Replace UUIDs from LocationInformationModel and fix the fallout.
Notably, replace the UUID "column" by a DIVESITE "column".
Getting pointers through Qt's QVariant is horrible, we'll have
to think about a better solution.
RECENTLY_ADDED_DIVESITE now defines to a special pointer to
struct dive_site (defined as ~0).
This fixes an interesting logic bug:
The old code checked the uuid of the LocationInformationModel (currUuid)
for the value "1", which corresponded to RECENTLY_ADDED_DIVESITE.
If equal, currType would be set to NEW_DIVE_SITE. Later, _currType_
was compared against _RECENTLY_ADDED_DIVESITE_. This would only work
because NEW_DIVE_SITE and RECENTLY_ADDED_DIVESITE both were defined
as 1.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/locationinformation.h')
-rw-r--r-- | desktop-widgets/locationinformation.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/desktop-widgets/locationinformation.h b/desktop-widgets/locationinformation.h index 9a270f80c..d01340b07 100644 --- a/desktop-widgets/locationinformation.h +++ b/desktop-widgets/locationinformation.h @@ -96,9 +96,9 @@ public: bool eventFilter(QObject*, QEvent*); void itemActivated(const QModelIndex& index); DiveSiteType currDiveSiteType() const; - uint32_t currDiveSiteUuid() const; + struct dive_site *currDiveSite() const; void fixPopupPosition(); - void setCurrentDiveSiteUuid(uint32_t uuid); + void setCurrentDiveSite(struct dive_site *ds); signals: void diveSiteSelected(); @@ -116,7 +116,7 @@ private: DiveLocationModel *model; DiveLocationListView *view; DiveSiteType currType; - uint32_t currUuid; + struct dive_site *currDs; }; #endif |