profile: pass dive to RulerItem

Instead of accessing the global displayed_dive variable
in RulerItem, pass the dive. This is a step in making the
profile reentrant.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-09 18:25:04 +01:00 committed by Dirk Hohndel
parent 54e8fe5d9e
commit 88c6ce988d
5 changed files with 11 additions and 9 deletions

View file

@ -36,7 +36,7 @@ public:
explicit RulerItem2();
void recalculate();
void setPlotInfo(const struct plot_info &pInfo);
void setPlotInfo(const struct dive *d, const struct plot_info &pInfo);
RulerNodeItem2 *sourceNode() const;
RulerNodeItem2 *destNode() const;
void setAxis(DiveCartesianAxis *time, DiveCartesianAxis *depth);
@ -47,6 +47,7 @@ slots:
void settingsChanged(bool toggled);
private:
const struct dive *dive;
struct plot_info pInfo;
QPointF startPoint, endPoint;
RulerNodeItem2 *source, *dest;