mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Properly de-select dives in collapsed trips that are unselected
We had the logic for the "select" case, but not for the "deselect" case. Ugh. Reported-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e53a7d87ec
commit
b18c34373f
1 changed files with 14 additions and 2 deletions
16
divelist.c
16
divelist.c
|
@ -2700,9 +2700,21 @@ static gboolean modify_selection_cb(GtkTreeSelection *selection, GtkTreeModel *m
|
||||||
gtk_tree_model_get_iter(model, &iter, path);
|
gtk_tree_model_get_iter(model, &iter, path);
|
||||||
gtk_tree_model_get(model, &iter, DIVE_INDEX, &idx, DIVE_DATE, &when, -1);
|
gtk_tree_model_get(model, &iter, DIVE_INDEX, &idx, DIVE_DATE, &when, -1);
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
|
int i;
|
||||||
|
struct dive *dive;
|
||||||
dive_trip_t *trip = find_trip_by_time(when);
|
dive_trip_t *trip = find_trip_by_time(when);
|
||||||
if (trip)
|
if (!trip)
|
||||||
trip->selected = 0;
|
return TRUE;
|
||||||
|
|
||||||
|
trip->selected = 0;
|
||||||
|
/* If this is expanded, let the gtk selection happen for each dive under it */
|
||||||
|
if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(dive_list.tree_view), path))
|
||||||
|
return TRUE;
|
||||||
|
/* Otherwise, consider each dive under it deselected */
|
||||||
|
for_each_dive(i, dive) {
|
||||||
|
if (dive->divetrip == trip)
|
||||||
|
deselect_dive(i);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
deselect_dive(idx);
|
deselect_dive(idx);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue