diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-06-05 09:29:41 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-06-05 11:29:00 -0700 |
commit | 0b190243dd4463f3c944037b8688372f9cce1c5d (patch) | |
tree | baffc5e0aebfc7947b70ecbf2599ea0917aaafee /profile-widget/diveeventitem.h | |
parent | fd2862042b1aa925bd842f512ee6260865e2f5b1 (diff) | |
download | subsurface-0b190243dd4463f3c944037b8688372f9cce1c5d.tar.gz |
profile: remove internal event-copy (fix deleting/renaming events)
The DiveEventItem had an internal copy of the event. It passed
that copy to the undo-machinery, which of course didn't work.
Simply keep a pointer to the event. All changes to a dive no
pass via the undo-machinery, which causes a reload of the profile,
so this should be safe.
Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/diveeventitem.h')
-rw-r--r-- | profile-widget/diveeventitem.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/profile-widget/diveeventitem.h b/profile-widget/diveeventitem.h index 1bb217d92..ca3cc2623 100644 --- a/profile-widget/diveeventitem.h +++ b/profile-widget/diveeventitem.h @@ -15,7 +15,8 @@ public: DivePlotDataModel *model, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis, int speed, QGraphicsItem *parent = nullptr); ~DiveEventItem(); - struct event *getEvent(); + const struct event *getEvent() const; + struct event *getEventMutable(); void eventVisibilityChanged(const QString &eventName, bool visible); void setVerticalAxis(DiveCartesianAxis *axis, int speed); void setHorizontalAxis(DiveCartesianAxis *axis); @@ -32,7 +33,7 @@ private: DiveCartesianAxis *vAxis; DiveCartesianAxis *hAxis; DivePlotDataModel *dataModel; - struct event *internalEvent; + struct event *ev; const struct dive *dive; }; |