From 0f2fac265fb876de971a2849bec69c51161d7a74 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 1 Feb 2013 00:07:04 +1100 Subject: [PATCH] Clear the list of events when closing data file When the data file is closed we should reset the events that we offer for filtering. Reported-by: Sergey Starosek Signed-off-by: Dirk Hohndel --- dive.h | 1 + gtk-gui.c | 1 + profile.c | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/dive.h b/dive.h index e719f2289..2b24ed932 100644 --- a/dive.h +++ b/dive.h @@ -552,6 +552,7 @@ extern void add_location(const char *string); extern void add_suit(const char *string); extern void remember_event(const char *eventname); extern void evn_foreach(void (*callback)(const char *, int *, void *), void *data); +extern void clear_events(void); extern int add_new_dive(struct dive *dive); extern gboolean edit_trip(dive_trip_t *trip); diff --git a/gtk-gui.c b/gtk-gui.c index 582e77c64..b55ee8d0a 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -248,6 +248,7 @@ static void file_close(GtkWidget *w, gpointer data) selected_dive = 0; process_selected_dives(); clear_stats_widgets(); + clear_events(); /* clear the equipment page */ clear_equipment_widgets(); diff --git a/profile.c b/profile.c index 130b32407..6f2e64664 100644 --- a/profile.c +++ b/profile.c @@ -313,6 +313,11 @@ void evn_foreach(void (*callback)(const char *, int *, void *), void *data) } } +void clear_events(void) +{ + evn_used = 0; +} + void remember_event(const char *eventname) { int i = 0, len;