From cbe678c4c58efdb0b0d7960a9c6d33c30a95ce8c Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 2 Aug 2011 15:23:52 +0200 Subject: Bug #655190 - Sluggish performance interacting with calendar/tasks --- calendar/gui/dialogs/goto-dialog.c | 6 +++++- calendar/gui/dialogs/recurrence-page.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'calendar/gui/dialogs') diff --git a/calendar/gui/dialogs/goto-dialog.c b/calendar/gui/dialogs/goto-dialog.c index 3ef0db31bf..7b8fffa430 100644 --- a/calendar/gui/dialogs/goto-dialog.c +++ b/calendar/gui/dialogs/goto-dialog.c @@ -52,6 +52,7 @@ typedef struct gint month_val; gint day_val; + GCancellable *cancellable; } GoToDialog; static GoToDialog *dlg = NULL; @@ -94,7 +95,7 @@ ecal_date_range_changed (ECalendarItem *calitem, gpointer user_data) model = gnome_calendar_get_model (dlg->gcal); client = e_cal_model_get_default_client (model); if (client) - tag_calendar_by_client (dlg->ecal, client); + tag_calendar_by_client (dlg->ecal, client, dlg->cancellable); } /* Event handler for day groups in the month item. A button press makes @@ -248,6 +249,7 @@ goto_dialog (GtkWindow *parent, GnomeCalendar *gcal) return; } dlg->gcal = gcal; + dlg->cancellable = g_cancellable_new (); model = gnome_calendar_get_model (gcal); timezone = e_cal_model_get_timezone (model); @@ -287,6 +289,8 @@ goto_dialog (GtkWindow *parent, GnomeCalendar *gcal) goto_today (dlg); g_object_unref (dlg->builder); + g_cancellable_cancel (dlg->cancellable); + g_object_unref (dlg->cancellable); g_free (dlg); dlg = NULL; } diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index bf8f1c191c..8e52250dfa 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -185,6 +185,8 @@ struct _RecurrencePagePrivate { /* This just holds some settings we need */ EMeetingStore *meeting_store; + + GCancellable *cancellable; }; @@ -266,7 +268,7 @@ preview_recur (RecurrencePage *rpage) fill_component (rpage, comp); tag_calendar_by_comp (E_CALENDAR (priv->preview_calendar), comp, - client, zone, TRUE, FALSE, FALSE); + client, zone, TRUE, FALSE, FALSE, priv->cancellable); g_object_unref (comp); } @@ -324,6 +326,12 @@ recurrence_page_dispose (GObject *object) priv->meeting_store = NULL; } + if (priv->cancellable) { + g_cancellable_cancel (priv->cancellable); + g_object_unref (priv->cancellable); + priv->cancellable = NULL; + } + /* Chain up to parent's dispose() method. */ G_OBJECT_CLASS (recurrence_page_parent_class)->dispose (object); } @@ -379,6 +387,8 @@ recurrence_page_init (RecurrencePage *rpage) { rpage->priv = G_TYPE_INSTANCE_GET_PRIVATE ( rpage, TYPE_RECURRENCE_PAGE, RecurrencePagePrivate); + + rpage->priv->cancellable = g_cancellable_new (); } /* get_widget handler for the recurrence page */ -- cgit v1.2.3