aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/diveeventitem.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-06-05 09:29:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-06-05 11:29:00 -0700
commit0b190243dd4463f3c944037b8688372f9cce1c5d (patch)
treebaffc5e0aebfc7947b70ecbf2599ea0917aaafee /profile-widget/diveeventitem.h
parentfd2862042b1aa925bd842f512ee6260865e2f5b1 (diff)
downloadsubsurface-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.h5
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;
};