mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
fd2862042b
commit
0b190243dd
4 changed files with 65 additions and 60 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue