diff options
| -rw-r--r-- | calendar/ChangeLog | 11 | ||||
| -rw-r--r-- | calendar/backends/http/e-cal-backend-http.c | 23 |
2 files changed, 28 insertions, 6 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index fee3a5268..7743f72a4 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,14 @@ +2004-05-19 Rodrigo Moya <rodrigo@ximian.com> + + Removes 100s of error dialogs as reported in #54211 + + * backends/http/e-cal-backend-http.c: added a flag to know when the + backend has been opened. + (reload_cb): set the "opened" flag to TRUE when we reload. + (retrieval_done): only notify errors when opening the backend, not + on each reload, or we'll get many error message dialogs when left + running for a few hours. + 2004-05-18 Harish Krishnaswamy <kharish@novell.com> Fixes #56320 and related timezone issues. diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c index c2167bdb3..55d430a11 100644 --- a/calendar/backends/http/e-cal-backend-http.c +++ b/calendar/backends/http/e-cal-backend-http.c @@ -63,6 +63,9 @@ struct _ECalBackendHttpPrivate { /* Reload */ guint reload_timeout_id; guint is_loading : 1; + + /* Flags */ + gboolean opened; }; @@ -217,8 +220,10 @@ retrieval_done (SoupMessage *msg, ECalBackendHttp *cbhttp) priv->uri = webcal_to_http_method (newuri); begin_retrieval_cb (cbhttp); } else { - e_cal_backend_notify_error (E_CAL_BACKEND (cbhttp), - _("Redirected to Invalid URI")); + if (!priv->opened) { + e_cal_backend_notify_error (E_CAL_BACKEND (cbhttp), + _("Redirected to Invalid URI")); + } } return; @@ -226,8 +231,10 @@ retrieval_done (SoupMessage *msg, ECalBackendHttp *cbhttp) /* check status code */ if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { - e_cal_backend_notify_error (E_CAL_BACKEND (cbhttp), - soup_status_get_phrase (msg->status_code)); + if (!priv->opened) { + e_cal_backend_notify_error (E_CAL_BACKEND (cbhttp), + soup_status_get_phrase (msg->status_code)); + } return; } @@ -238,12 +245,14 @@ retrieval_done (SoupMessage *msg, ECalBackendHttp *cbhttp) g_free (str); if (!icalcomp) { - e_cal_backend_notify_error (E_CAL_BACKEND (cbhttp), _("Bad file format.")); + if (!priv->opened) + e_cal_backend_notify_error (E_CAL_BACKEND (cbhttp), _("Bad file format.")); return; } if (icalcomponent_isa (icalcomp) != ICAL_VCALENDAR_COMPONENT) { - e_cal_backend_notify_error (E_CAL_BACKEND (cbhttp), _("Not a calendar.")); + if (!priv->opened) + e_cal_backend_notify_error (E_CAL_BACKEND (cbhttp), _("Not a calendar.")); icalcomponent_free (icalcomp); return; } @@ -327,6 +336,7 @@ reload_cb (ECalBackendHttp *cbhttp) d(g_message ("Reload!\n")); priv->reload_timeout_id = 0; + priv->opened = TRUE; begin_retrieval_cb (cbhttp); return FALSE; } @@ -809,6 +819,7 @@ e_cal_backend_http_init (ECalBackendHttp *cbhttp, ECalBackendHttpClass *class) priv->uri = NULL; priv->reload_timeout_id = 0; + priv->opened = FALSE; } /* Class initialization function for the file backend */ |
