summaryrefslogtreecommitdiffstats
path: root/statistics.c
diff options
context:
space:
mode:
Diffstat (limited to 'statistics.c')
-rw-r--r--statistics.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/statistics.c b/statistics.c
index 19105653c..7ff2bfd01 100644
--- a/statistics.c
+++ b/statistics.c
@@ -142,25 +142,25 @@ static void process_all_dives(struct dive *dive, struct dive **prev_dive)
}
}
-void process_selected_dives(GList *selected_dives, GtkTreeModel *model)
+/* 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;
- GtkTreeIter iter;
- GtkTreePath *path;
+ int idx;
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);
- dp = get_dive(g_value_get_int(&value));
+ idx = selectiontracker[i];
+ if (idx > 0) {
+ dp = get_dive(idx);
+ if (dp) {
+ process_dive(dp, &stats_selection);
+ }
}
- process_dive(dp, &stats_selection);
}
+ stats_selection.selection_size = amount_selected;
}
static void set_label(GtkWidget *w, const char *fmt, ...)