X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=statistics.c;h=7ff2bfd016e6dcdf727dd7f9bb7a37629925bf40;hb=94516177605484dacf724602c43f34b984d06ba8;hp=adfc9c77ac4f471922178d01de73c6d122b742c6;hpb=dc9d0e23e5d158ea4775021b2f629e7f90b5377c;p=ext%2Fsubsurface.git diff --git a/statistics.c b/statistics.c index adfc9c7..7ff2bfd 100644 --- a/statistics.c +++ b/statistics.c @@ -142,30 +142,25 @@ static void process_all_dives(struct dive *dive, struct dive **prev_dive) } } +/* make sure we skip the selected summary entries */ void process_selected_dives(GList *selected_dives, int *selectiontracker, GtkTreeModel *model) { struct dive *dp; unsigned int i; int idx; - GtkTreeIter iter; - GtkTreePath *path; memset(&stats_selection, 0, sizeof(stats_selection)); - stats_selection.selection_size = amount_selected; for (i = 0; i < amount_selected; ++i) { - GValue value = {0, }; - 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); - idx = g_value_get_int(&value); + idx = selectiontracker[i]; + if (idx > 0) { dp = get_dive(idx); if (dp) { - selectiontracker[i] = idx; process_dive(dp, &stats_selection); } } } + stats_selection.selection_size = amount_selected; } static void set_label(GtkWidget *w, const char *fmt, ...)