From 92a2ca0066a646bdf22d2eb55a03e45415f60ac9 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 10 Aug 2012 11:37:40 +0200 Subject: Bug #676785 - Enables wrong calendar after saving appointment --- calendar/gui/e-calendar-view.c | 11 ++++++----- calendar/gui/e-calendar-view.h | 6 ++++-- calendar/gui/e-day-view.c | 2 +- calendar/gui/e-week-view.c | 2 +- modules/calendar/e-cal-shell-view-private.c | 9 ++++----- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index fb82854de3..795aacabc4 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -943,8 +943,8 @@ e_calendar_view_class_init (ECalendarViewClass *class) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ECalendarViewClass, user_created), NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[OPEN_EVENT] = g_signal_new ( "open-event", @@ -1677,7 +1677,7 @@ static void object_created_cb (CompEditor *ce, ECalendarView *cal_view) { - e_calendar_view_emit_user_created (cal_view); + e_calendar_view_emit_user_created (cal_view, comp_editor_get_client (ce)); } CompEditor * @@ -2180,11 +2180,12 @@ e_calendar_view_get_icalcomponent_summary (ECalClient *client, } void -e_calendar_view_emit_user_created (ECalendarView *cal_view) +e_calendar_view_emit_user_created (ECalendarView *cal_view, + ECalClient *where_was_created) { g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view)); - g_signal_emit (cal_view, signals[USER_CREATED], 0); + g_signal_emit (cal_view, signals[USER_CREATED], 0, where_was_created); } void diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h index 219305dceb..ab4d4e3778 100644 --- a/calendar/gui/e-calendar-view.h +++ b/calendar/gui/e-calendar-view.h @@ -143,7 +143,8 @@ struct _ECalendarViewClass { ECalendarViewEvent *event); void (*event_added) (ECalendarView *day_view, ECalendarViewEvent *event); - void (*user_created) (ECalendarView *cal_view); + void (*user_created) (ECalendarView *cal_view, + ECalClient *where_was_created); /* Virtual methods */ GList * (*get_selected_events) (ECalendarView *cal_view); @@ -261,7 +262,8 @@ const gchar * e_calendar_view_get_icalcomponent_summary gboolean *free_text); void e_calendar_view_emit_user_created - (ECalendarView *cal_view); + (ECalendarView *cal_view, + ECalClient *where_was_created); void draw_curved_rectangle (cairo_t *cr, gdouble x0, diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index c2b7fc78fd..2b935f3f3a 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -6898,7 +6898,7 @@ e_day_view_on_editing_stopped (EDayView *day_view, } else { icalcomponent_set_uid (icalcomp, uid); e_calendar_view_emit_user_created ( - E_CALENDAR_VIEW (day_view)); + E_CALENDAR_VIEW (day_view), client); } g_free (uid); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 613ab9e5b9..4810f0c82d 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -4056,7 +4056,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, icalcomponent_set_uid (icalcomp, uid); e_calendar_view_emit_user_created ( - E_CALENDAR_VIEW (week_view)); + E_CALENDAR_VIEW (week_view), client); } if (uid) diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 0f7b0b7a17..721a8c9ba0 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -360,16 +360,15 @@ cal_shell_view_taskpad_popup_event_cb (EShellView *shell_view, static void cal_shell_view_user_created_cb (ECalShellView *cal_shell_view, + ECalClient *where_was_created, ECalendarView *calendar_view) { ECalShellSidebar *cal_shell_sidebar; - ECalModel *model; - ECalClient *client; ESource *source; - model = e_calendar_view_get_model (calendar_view); - client = e_cal_model_get_default_client (model); - source = e_client_get_source (E_CLIENT (client)); + g_return_if_fail (where_was_created != NULL); + + source = e_client_get_source (E_CLIENT (where_was_created)); cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar; e_cal_shell_sidebar_add_source (cal_shell_sidebar, source); -- cgit