summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-22 08:19:34 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-22 08:19:34 -0700
commit2df6149080d81fa0aa1f999d9367f57206ae1b94 (patch)
tree1f38c7279ff7f664566ab4c20524546081932343 /divelist.c
parente11523110b14056f88a39bacafabb0f55aebbf89 (diff)
downloadsubsurface-2df6149080d81fa0aa1f999d9367f57206ae1b94.tar.gz
Select the first dive after filling the dive list
We should always strive to have a dive selected, so pick the first one (that was how the dive list logic worked anyway, it just wasn't truly selected at the tree-view level, so it wasn't *visibly* the selected dive). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c
index f1af80cea..8967d3612 100644
--- a/divelist.c
+++ b/divelist.c
@@ -403,6 +403,11 @@ static void fill_dive_list(void)
}
update_dive_list_units();
+ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(dive_list.model), &iter)) {
+ GtkTreeSelection *selection;
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dive_list.tree_view));
+ gtk_tree_selection_select_iter(selection, &iter);
+ }
}
void dive_list_update_dives(void)