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:
Linus Torvalds 2013-01-29 21:26:07 +11:00 committed by Dirk Hohndel
parent 8cbe2af4e9
commit 14524d8e1d

View file

@ -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);
}
}