From 24926f603182098e023f7da62c6720112fa7f86f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 17 Sep 2022 19:51:53 +0200 Subject: [PATCH] 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 --- profile-widget/profilewidget2.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 549aa982e..89d1b2840 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -246,9 +246,7 @@ void ProfileWidget2::divesChanged(const QVector &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(); }