profile: don't use displayed_dive to check whether dive changed

The profile replots if the mode of the currently displayed
dive changed. To do so, it compares the changed dive to
the displayed_dive. However, that is only used for planned
dives since quite some time.

Fix the check and make the replotting work again.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-09-17 19:51:53 +02:00
parent 3abb82bfd5
commit 24926f6031

View file

@ -246,9 +246,7 @@ void ProfileWidget2::divesChanged(const QVector<dive *> &dives, DiveField field)
{
// If the mode of the currently displayed dive changed, replot
if (field.mode &&
std::any_of(dives.begin(), dives.end(),
[id = displayed_dive.id] (const dive *d)
{ return d->id == id; } ))
std::find(dives.begin(), dives.end(), d) != dives.end())
replot();
}