From 3a28caed5809cfd099c6b0daafa953cd1f05e9f8 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 18 Oct 2001 15:11:28 +0000 Subject: util routine to handle calling back (async_close): use above 2001-10-18 JP Rosevear * gui/e-meeting-model.c (process_callbacks): util routine to handle calling back (async_close): use above (e_meeting_model_refresh_busy_periods): ditto svn path=/trunk/; revision=13747 --- calendar/gui/e-meeting-model.c | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c index 0cc67304ee..273a25672a 100644 --- a/calendar/gui/e-meeting-model.c +++ b/calendar/gui/e-meeting-model.c @@ -1036,6 +1036,28 @@ process_free_busy_comp (EMeetingAttendee *ia, icalcomponent *fb_comp, icalcompon } } +static void +process_callbacks (EMeetingModel *im) +{ + EMeetingModelPrivate *priv; + GList *l, *m; + + priv = im->priv; + + for (l = priv->refresh_callbacks, m = priv->refresh_data; l != NULL; l = l->next, m = m->next) { + EMeetingModelRefreshCallback cb = l->data; + + cb (m->data); + } + + g_list_free (priv->refresh_callbacks); + g_list_free (priv->refresh_data); + priv->refresh_callbacks = NULL; + priv->refresh_data = NULL; + + priv->refreshing = FALSE; +} + static void process_free_busy (EMeetingModel *im, EMeetingAttendee *ia, char *text) { @@ -1096,17 +1118,8 @@ async_close (GnomeVFSAsyncHandle *handle, priv->refresh_count--; - if (priv->refresh_count == 0) { - GList *l, *m; - - for (l = priv->refresh_callbacks, m = priv->refresh_data; l != NULL; l = l->next, m = m->next) { - EMeetingModelRefreshCallback cb = l->data; - - cb (m->data); - } - - priv->refreshing = FALSE; - } + if (priv->refresh_count == 0) + process_callbacks (r_data->im); } static void @@ -1253,7 +1266,11 @@ e_meeting_model_refresh_busy_periods (EMeetingModel *im, EMeetingModelRefreshCal if (ia != NULL) process_free_busy (im, ia, cal_component_get_as_string (comp)); - } + + process_callbacks (im); + } + + } /* Look for fburl's of attendee with no free busy info on server */ -- cgit