mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Fix cursor up/down logic
The dive selection rewrite didn't set the selected dive index, breaking the cursor key logic. 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
8cbe2af4e9
commit
14524d8e1d
1 changed files with 5 additions and 3 deletions
|
@ -2595,11 +2595,13 @@ static void sort_column_change_cb(GtkTreeSortable *treeview, gpointer data)
|
|||
}
|
||||
}
|
||||
|
||||
static void select_dive(struct dive *dive)
|
||||
static void select_dive(int idx)
|
||||
{
|
||||
struct dive *dive = get_dive(idx);
|
||||
if (dive && !dive->selected) {
|
||||
dive->selected = 1;
|
||||
amount_selected++;
|
||||
selected_dive = idx;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2624,10 +2626,10 @@ static void entry_selected(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *
|
|||
/* Otherwise, consider each dive under it selected */
|
||||
for_each_dive(i, dive) {
|
||||
if (dive->divetrip == trip)
|
||||
select_dive(dive);
|
||||
select_dive(i);
|
||||
}
|
||||
} else {
|
||||
select_dive(get_dive(idx));
|
||||
select_dive(idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue