aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-day-view.c29
-rw-r--r--calendar/gui/e-week-view.c13
2 files changed, 25 insertions, 17 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 2dd2c1cca2..a13c059b15 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -525,12 +525,22 @@ process_component (EDayView *day_view, ECalModelComponent *comp_data)
if (day_view->lower == 0 && day_view->upper == 0)
return;
+ comp = e_cal_component_new ();
+ if (!e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp))) {
+ g_object_unref (comp);
+
+ g_message (G_STRLOC ": Could not set icalcomponent on ECalComponent");
+ return;
+ }
+
+ e_cal_component_get_uid (comp, &uid);
+
/* If the event already exists and the dates didn't change, we can
update the event fairly easily without changing the events arrays
or computing a new layout. */
- uid = icalcomponent_get_uid (comp_data->icalcomp);
-
if (e_day_view_find_event_from_uid (day_view, uid, &day, &event_num)) {
+ ECalComponent *tmp_comp;
+
if (day == E_DAY_VIEW_LONG_EVENT)
event = &g_array_index (day_view->long_events,
EDayViewEvent, event_num);
@@ -538,8 +548,11 @@ process_component (EDayView *day_view, ECalModelComponent *comp_data)
event = &g_array_index (day_view->events[day],
EDayViewEvent, event_num);
+ tmp_comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (tmp_comp, icalcomponent_new_clone (event->comp_data->icalcomp));
if (!e_cal_util_component_has_recurrences (comp_data->icalcomp)
- && e_cal_util_event_dates_match (event->comp_data->icalcomp, comp_data->icalcomp)) {
+ && !e_cal_component_has_recurrences (tmp_comp)
+ && e_cal_component_event_dates_match (comp, tmp_comp)) {
#if 0
g_print ("updated object's dates unchanged\n");
#endif
@@ -557,12 +570,11 @@ process_component (EDayView *day_view, ECalModelComponent *comp_data)
e_day_view_foreach_event_with_uid (day_view, uid,
e_day_view_remove_event_cb,
NULL);
+
+ g_object_unref (tmp_comp);
}
/* Add the occurrences of the event */
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
-
add_event_data.day_view = day_view;
add_event_data.comp_data = comp_data;
e_cal_recur_generate_instances (comp, day_view->lower,
@@ -1033,9 +1045,8 @@ e_day_view_init (EDayView *day_view)
target_table, n_targets,
GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK);
- /* Set the default model */
- model = E_CAL_MODEL (e_cal_model_calendar_new ());
- e_calendar_view_set_model (E_CALENDAR_VIEW (day_view), model);
+ /* Get the model */
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view));
/* connect to ECalModel's signals */
g_signal_connect (G_OBJECT (model), "time_range_changed",
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 14ed7f72c6..8ada75bbd3 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -345,7 +345,7 @@ process_component (EWeekView *week_view, ECalModelComponent *comp_data)
if (!e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp))) {
g_object_unref (comp);
- g_message ("process_component(): Could not set icalcomponent on ECalComponent");
+ g_message (G_STRLOC ": Could not set icalcomponent on ECalComponent");
return;
}
@@ -361,7 +361,7 @@ process_component (EWeekView *week_view, ECalModelComponent *comp_data)
event_num);
tmp_comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (tmp_comp, icalcomponent_new_clone (comp_data->icalcomp));
+ e_cal_component_set_icalcomponent (tmp_comp, icalcomponent_new_clone (event->comp_data->icalcomp));
if (!e_cal_component_has_recurrences (comp)
&& !e_cal_component_has_recurrences (tmp_comp)
&& e_cal_component_event_dates_match (comp, tmp_comp)) {
@@ -400,8 +400,6 @@ process_component (EWeekView *week_view, ECalModelComponent *comp_data)
e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
g_object_unref (comp);
-
- e_week_view_queue_layout (week_view);
}
static void
@@ -676,10 +674,9 @@ e_week_view_init (EWeekView *week_view)
week_view->resize_width_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
week_view->last_cursor_set = NULL;
- /* Set the default model */
- model = E_CAL_MODEL (e_cal_model_calendar_new ());
- e_calendar_view_set_model (E_CALENDAR_VIEW (week_view), model);
-
+ /* Get the model */
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+
/* connect to ECalModel's signals */
g_signal_connect (G_OBJECT (model), "time_range_changed",
G_CALLBACK (time_range_changed_cb), week_view);