Re: [evolution-patches] Patch to make FreeBusy calls from Evo calendar async with the main thread



On Mon, 2004-10-11 at 13:59 +0530, Harish Krishnaswamy wrote:
> +       query = g_strdup_printf ("(contains \"email\" \"%s\")", 
> +                                itip_strip_mailto
> (e_meeting_attendee_get_address (attendee)));
> +       process_callbacks (fbd->qdata);
> +       g_free (query);
> +
>
query is not being used here at all, is it?

> @@ -325,12 +325,11 @@ clear_widgets (MeetingPage *mpage)
>  static void
>  sensitize_widgets (MeetingPage *mpage)
>  {
> -       gboolean read_only, user_org;
> +       gboolean read_only = FALSE, user_org;
>         MeetingPagePrivate *priv = mpage->priv;
> -
> -       if (!e_cal_is_read_only (COMP_EDITOR_PAGE (mpage)->client,
> &read_only, NULL))
> -               read_only = TRUE;
> -
> +       GError *error;
> +       
> +       e_cal_is_read_only (COMP_EDITOR_PAGE (mpage)->client,
> &read_only, &error);
>         gtk_widget_set_sensitive (priv->organizer, !read_only);
>         gtk_widget_set_sensitive (priv->existing_organizer_btn, !
> read_only);
>         gtk_widget_set_sensitive (priv->add, !read_only && priv-
> >user_org);
> 
here, you should be doing something with the GError, at least free it if
e_cal_is_read_only returns something there. So, I would change this
with:

if (!e_cal_is_read_only (...)) {
	read_only = TRUE;
	display_error_somewhere;
	g_error_free (error);
}

thus, if the call fails, we disable all the widgets, as if it were a
read only calendar.
-- 
Rodrigo Moya <rodrigo novell com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]