From be9f9efb0eae6f09db4c61de7a5156b186dc2ad6 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Date: Sat, 9 Jan 2021 18:58:33 +0100 Subject: profile: pass dive to EventItem Don't access the global displayed_dive variable in an effort to make the profile reentrant. Note that this still accesses the global dc_number variable, which will likely have to be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> --- profile-widget/diveeventitem.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'profile-widget/diveeventitem.h') diff --git a/profile-widget/diveeventitem.h b/profile-widget/diveeventitem.h index 0c065e131..1b2c1c5ba 100644 --- a/profile-widget/diveeventitem.h +++ b/profile-widget/diveeventitem.h @@ -13,7 +13,7 @@ class DiveEventItem : public DivePixmapItem { public: DiveEventItem(QGraphicsItem *parent = 0); ~DiveEventItem(); - void setEvent(struct event *ev, struct gasmix lastgasmix); + void setEvent(const struct dive *d, struct event *ev, struct gasmix lastgasmix); struct event *getEvent(); void eventVisibilityChanged(const QString &eventName, bool visible); void setVerticalAxis(DiveCartesianAxis *axis, int speed); @@ -32,6 +32,7 @@ private: DiveCartesianAxis *hAxis; DivePlotDataModel *dataModel; struct event *internalEvent; + const struct dive *dive; }; #endif // DIVEEVENTITEM_H -- cgit v1.2.3-70-g09d2