X-Git-Url: http://git.tdb.fi/?p=ext%2Fsubsurface.git;a=blobdiff_plain;f=statistics.c;h=adfc9c77ac4f471922178d01de73c6d122b742c6;hp=19105653c2aa1ad8014cfa095dd86bf524f940fc;hb=dc9d0e23e5d158ea4775021b2f629e7f90b5377c;hpb=27a505e579057596ab10f7381c471b870ce86f87 diff --git a/statistics.c b/statistics.c index 1910565..adfc9c7 100644 --- a/statistics.c +++ b/statistics.c @@ -142,10 +142,11 @@ static void process_all_dives(struct dive *dive, struct dive **prev_dive) } } -void process_selected_dives(GList *selected_dives, GtkTreeModel *model) +void process_selected_dives(GList *selected_dives, int *selectiontracker, GtkTreeModel *model) { struct dive *dp; unsigned int i; + int idx; GtkTreeIter iter; GtkTreePath *path; @@ -157,9 +158,13 @@ void process_selected_dives(GList *selected_dives, GtkTreeModel *model) path = g_list_nth_data(selected_dives, i); if (gtk_tree_model_get_iter(model, &iter, path)) { gtk_tree_model_get_value(model, &iter, 0, &value); - dp = get_dive(g_value_get_int(&value)); + idx = g_value_get_int(&value); + dp = get_dive(idx); + if (dp) { + selectiontracker[i] = idx; + process_dive(dp, &stats_selection); + } } - process_dive(dp, &stats_selection); } }