aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-11-24 21:28:53 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:04 +0800
commit57185da9834daeb3169b6e76bc817cb659648450 (patch)
treef2a6ac84ed9198d8e3db966601f36c55065a4494 /calendar/gui
parentaaf95d222df880565db862c953638dcb04e8dbb7 (diff)
downloadgsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.tar
gsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.tar.gz
gsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.tar.bz2
gsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.tar.lz
gsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.tar.xz
gsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.tar.zst
gsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.zip
Bug #635673 - Stack overflow when opening slow calendar
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-cal-model.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 294b54c760..f33a6f55c1 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -2524,6 +2524,19 @@ backend_died_cb (ECal *client, gpointer user_data)
e_cal_model_remove_client (model, client);
}
+static gboolean
+wait_open_cb (gpointer data)
+{
+ ECal *client = data;
+
+ g_return_val_if_fail (client != NULL, FALSE);
+ g_return_val_if_fail (E_IS_CAL (client), FALSE);
+
+ e_cal_open_async (client, FALSE);
+
+ return FALSE;
+}
+
static void
cal_opened_cb (ECal *client, const GError *error, gpointer user_data)
{
@@ -2531,10 +2544,13 @@ cal_opened_cb (ECal *client, const GError *error, gpointer user_data)
ECalModelClient *client_data;
if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_BUSY)) {
- e_cal_open_async (client, FALSE);
+ g_timeout_add (250, wait_open_cb, client);
return;
}
+ /* Stop listening for this calendar to be opened */
+ g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, cal_opened_cb, model);
+
if (error) {
e_cal_model_remove_client (model, client);
e_cal_model_update_status_message (model, NULL, -1.0);
@@ -2543,9 +2559,6 @@ cal_opened_cb (ECal *client, const GError *error, gpointer user_data)
e_cal_model_update_status_message (model, NULL, -1.0);
- /* Stop listening for this calendar to be opened */
- g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, cal_opened_cb, model);
-
client_data = find_client_data (model, client);
g_return_if_fail (client_data);