Fix silly thinko in recent changes to "Delete dive" code

Commit 38c79d149d ("Simplify and clean up dive trip management")
simplified the code a bit *too* much, and removed the check for
"dive->selected".

As a result, trying to delete a dive resulted in *all* dives being
deleted.

Oops.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2012-11-17 13:04:31 -08:00 committed by Dirk Hohndel
parent 804b22dcd9
commit d166e34fed

View file

@ -2032,6 +2032,8 @@ static void delete_selected_dives_cb(GtkWidget *menuitem, GtkTreePath *path)
dive = get_dive(i); dive = get_dive(i);
if (!dive) if (!dive)
continue; continue;
if (!dive->selected)
continue;
/* now remove the dive from the table and free it. also move the iterator back, /* now remove the dive from the table and free it. also move the iterator back,
* so that we don't skip a dive */ * so that we don't skip a dive */
delete_single_dive(i); delete_single_dive(i);