summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-11-17 13:04:31 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-19 12:02:09 -0800
commitd166e34fed53786000b9afa353e806b918d53714 (patch)
tree9af1b1857320b0a04d85af3592a61fe8ebf108f2 /divelist.c
parent804b22dcd9dd5beb316640997fa559929fdb5d2a (diff)
downloadsubsurface-d166e34fed53786000b9afa353e806b918d53714.tar.gz
Fix silly thinko in recent changes to "Delete dive" code
Commit 38c79d149db0 ("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>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c
index 3e48d2fb9..59db7c208 100644
--- a/divelist.c
+++ b/divelist.c
@@ -2032,6 +2032,8 @@ static void delete_selected_dives_cb(GtkWidget *menuitem, GtkTreePath *path)
dive = get_dive(i);
if (!dive)
continue;
+ if (!dive->selected)
+ continue;
/* now remove the dive from the table and free it. also move the iterator back,
* so that we don't skip a dive */
delete_single_dive(i);