planner: pass in_planner argument to replot()

To remove reliance on global state, pass an "in_planner" argument
to AbstractProfilePolygonItem::replot(). Thus, calls to in_planner()
can be removed.

This is a bit sad, since the in_planner argument is now passed
to numerous replot() reimplementations of classes derived
from AbstractProfilePolygonItem. However, it is only needed
for one, viz. DiveGasPressureItem. Well, perhaps in the future
more features will depend on the planner mode...

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-02-13 17:42:03 +01:00 committed by Dirk Hohndel
parent 65720d2fce
commit c6d78bc134
3 changed files with 28 additions and 28 deletions

View file

@ -728,7 +728,7 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
// Replot dive items
for (AbstractProfilePolygonItem *item: profileItems)
item->replot(&displayed_dive);
item->replot(&displayed_dive, currentState == PLAN);
// The event items are a bit special since we don't know how many events are going to
// exist on a dive, so I cant create cache items for that. that's why they are here