aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog41
-rw-r--r--calendar/gui/dialogs/comp-editor.c8
-rw-r--r--calendar/gui/dialogs/recur-comp.c13
-rw-r--r--calendar/gui/e-cal-model.c25
-rw-r--r--calendar/gui/e-calendar-view.c58
-rw-r--r--calendar/gui/e-day-view-main-item.c2
-rw-r--r--calendar/gui/e-day-view-top-item.c2
-rw-r--r--calendar/gui/e-day-view.c121
-rw-r--r--calendar/gui/e-week-view-event-item.c2
-rw-r--r--calendar/gui/e-week-view.c48
10 files changed, 256 insertions, 64 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 771016c92a..45d3016472 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,44 @@
+2005-05-06 Rodrigo Moya <rodrigo@novell.com>
+
+ Fixes #271679
+
+ * gui/dialogs/comp-editor.c (save_comp):
+ * gui/e-week-view.c (e_week_view_on_editing_stopped,
+ e_week_view_change_event_time): set correct start/end times for
+ individual instances and remove all rules and exceptions.
+ (e_week_view_reshape_event_span): show recurrence icons for
+ detached instances also.
+
+ * gui/e-day-view.c (e_day_view_finish_resize,
+ e_day_view_finish_long_event_resize, e_day_view_on_editing_stopped,
+ e_day_view_on_top_canvas_drag_data_received,
+ e_day_view_on_main_canvas_drag_data_received,
+ e_day_view_change_event_time): set the correct start/end times when
+ modifying individual instances and remove all rules and exceptions.
+ (e_day_view_on_top_canvas_motion, e_day_view_on_main_canvas_motion):
+ disable D&D for recurring events.
+ (e_day_view_reshape_long_event, e_day_view_reshape_day_event):
+ check for detached instances and show recurrence icons for them also.
+
+ * gui/e-week-view-event-item.c (e_week_view_event_item_draw_icons):
+ * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
+ * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
+ check for detached instances and show recurrence icons for them also.
+
+ * gui/e-cal-model.c (set_instance_times): don't use the RECURRENCE-ID
+ to get the datetime.
+
+ * gui/e-calendar-view.c (e_calendar_view_delete_selected_occurrence):
+ exceptions need to be date only.
+ (e_calendar_view_copy_clipboard): remove RECURRENCE-IDs from components
+ we copy to the clipboard.
+ (e_calendar_view_cut_clipboard): when cutting instances, remove only
+ the selected instances.
+ (on_unrecur_appointment): use MOD_ALL to modify the master object and
+ remove recurrence-id from detached event.
+
+ * gui/dialogs/recur-comp.c (recur_component_dialog): re-enabled.
+
2005-05-05 Rodrigo Moya <rodrigo@novell.com>
* gui/dialogs/event-page.c:
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 26cc13e179..1e41a74ff4 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -650,6 +650,12 @@ save_comp (CompEditor *editor)
if (!cal_comp_is_on_server (priv->comp, priv->client)) {
result = e_cal_create_object (priv->client, icalcomp, NULL, &error);
} else {
+ if (priv->mod == CALOBJ_MOD_THIS) {
+ e_cal_component_set_rdate_list (priv->comp, NULL);
+ e_cal_component_set_rrule_list (priv->comp, NULL);
+ e_cal_component_set_exdate_list (priv->comp, NULL);
+ e_cal_component_set_exrule_list (priv->comp, NULL);
+ }
result = e_cal_modify_object (priv->client, icalcomp, priv->mod, &error);
}
@@ -1830,7 +1836,7 @@ real_send_comp (CompEditor *editor, ECalComponentItipMethod method)
comp_editor_set_changed (editor, TRUE);
- return FALSE;
+ return FALSE;
}
diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c
index 734516e904..cfffa29c69 100644
--- a/calendar/gui/dialogs/recur-comp.c
+++ b/calendar/gui/dialogs/recur-comp.c
@@ -36,7 +36,6 @@ recur_component_dialog (ECal *client,
CalObjModType *mod,
GtkWindow *parent)
{
-#if 0
char *str;
GtkWidget *dialog, *rb_this, *rb_prior, *rb_future, *rb_all, *hbox;
GtkWidget *placeholder, *vbox;
@@ -134,16 +133,4 @@ recur_component_dialog (ECal *client,
gtk_widget_destroy (dialog);
return ret;
-#endif
-
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (e_cal_component_get_icalcomponent (comp),
- ICAL_RECURRENCEID_PROPERTY);
- if (prop)
- icalcomponent_remove_property (e_cal_component_get_icalcomponent (comp), prop);
-
- *mod = CALOBJ_MOD_ALL;
-
- return TRUE;
}
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index ca0f16a4ba..872ace383d 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -1301,12 +1301,7 @@ set_instance_times (ECalModelComponent *comp_data, icaltimezone *zone)
start_time = icalcomponent_get_dtstart (comp_data->icalcomp);
end_time = icalcomponent_get_dtend (comp_data->icalcomp);
- if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
- itt = icaltime_convert_to_zone (recur_time, icaltimezone_get_utc_timezone ());
- comp_data->instance_start = icaltime_as_timet (itt);
- } else {
- comp_data->instance_start = icaltime_as_timet (start_time);
- }
+ comp_data->instance_start = icaltime_as_timet (start_time);
comp_data->instance_end = comp_data->instance_start +
(icaltime_as_timet (end_time) - icaltime_as_timet (start_time));
@@ -1324,17 +1319,17 @@ e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer user_data
for (l = objects; l; l = l->next) {
ECalModelComponent *comp_data;
- /* remove the components if they are already present and re-add them */
- while ((comp_data = search_by_uid_and_client (priv, e_cal_view_get_client (query),
- icalcomponent_get_uid (l->data)))) {
- int pos;
+/* /\* remove the components if they are already present and re-add them *\/ */
+/* while ((comp_data = search_by_uid_and_client (priv, e_cal_view_get_client (query), */
+/* icalcomponent_get_uid (l->data)))) { */
+/* int pos; */
- pos = get_position_in_array (priv->objects, comp_data);
- e_table_model_row_deleted (E_TABLE_MODEL (model), pos);
+/* pos = get_position_in_array (priv->objects, comp_data); */
+/* e_table_model_row_deleted (E_TABLE_MODEL (model), pos); */
- g_ptr_array_remove (priv->objects, comp_data);
- e_cal_model_free_component_data (comp_data);
- }
+/* g_ptr_array_remove (priv->objects, comp_data); */
+/* e_cal_model_free_component_data (comp_data); */
+/* } */
if ((priv->flags & E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES)) {
RecurrenceExpansionData rdata;
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index a3e5a6ce3a..f879d3d63a 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -670,7 +670,21 @@ e_calendar_view_cut_clipboard (ECalendarView *cal_view)
event->comp_data->client, NULL, NULL);
e_cal_component_get_uid (comp, &uid);
- e_cal_remove_object (event->comp_data->client, uid, &error);
+ if (e_cal_component_is_instance (comp)) {
+ const char *rid;
+ icalcomponent *icalcomp;
+
+ /* when cutting detached instances, only cut that instance */
+ rid = e_cal_component_get_recurid_as_string (comp);
+ if (e_cal_get_object (event->comp_data->client, uid, rid, &icalcomp, NULL)) {
+ e_cal_remove_object_with_mod (event->comp_data->client, uid,
+ rid, CALOBJ_MOD_THIS,
+ &error);
+ icalcomponent_free (icalcomp);
+ } else
+ e_cal_remove_object (event->comp_data->client, uid, &error);
+ } else
+ e_cal_remove_object (event->comp_data->client, uid, &error);
delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
g_clear_error (&error);
@@ -711,6 +725,15 @@ e_calendar_view_copy_clipboard (ECalendarView *cal_view)
event = (ECalendarViewEvent *) l->data;
new_icalcomp = icalcomponent_new_clone (event->comp_data->icalcomp);
+
+ /* remove RECURRENCE-IDs from copied objects */
+ if (e_cal_util_component_is_instance (new_icalcomp)) {
+ icalproperty *prop;
+
+ prop = icalcomponent_get_first_property (new_icalcomp, ICAL_RECURRENCEID_PROPERTY);
+ if (prop)
+ icalcomponent_remove_property (new_icalcomp, prop);
+ }
icalcomponent_add_component (vcal_comp, new_icalcomp);
}
@@ -885,6 +908,9 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
const char *uid, *rid = NULL;
GError *error = NULL;
ECalComponent *comp;
+ struct icaltimetype itt;
+ ECalComponentDateTime dt;
+ icaltimezone *zone;
selected = e_calendar_view_get_selected_events (cal_view);
if (!selected)
@@ -895,27 +921,17 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
e_cal_component_get_uid (comp, &uid);
- if (e_cal_component_is_instance (comp))
- rid = e_cal_component_get_recurid_as_string (comp);
- else {
- ECalComponentDateTime dt;
- icaltimezone *zone;
- if (!e_cal_component_has_recurrences (comp)) {
- g_object_unref (comp);
- return;
- }
+ e_cal_component_get_dtstart (comp, &dt);
+ e_cal_get_timezone (event->comp_data->client, dt.tzid, &zone, NULL);
- /* get the RECUR-ID from the instance start date */
- e_cal_component_get_dtstart (comp, &dt);
- if (e_cal_get_timezone (event->comp_data->client, dt.tzid, &zone, NULL)) {
- rid = icaltime_as_ical_string (
- icaltime_from_timet_with_zone (event->comp_data->instance_start, TRUE, zone));
- } else
- rid = icaltime_as_ical_string (icaltime_from_timet (event->comp_data->instance_start, TRUE));
+ if (zone)
+ itt = icaltime_from_timet_with_zone (event->comp_data->instance_start, TRUE, zone);
+ else
+ itt = icaltime_from_timet (event->comp_data->instance_start, TRUE);
+ rid = icaltime_as_ical_string (itt);
- e_cal_component_free_datetime (&dt);
- }
+ e_cal_component_free_datetime (&dt);
if (rid) {
if (delete_component_dialog (comp, FALSE, 1, e_cal_component_get_vtype (comp), GTK_WIDGET (cal_view))) {
@@ -1275,6 +1291,7 @@ on_unrecur_appointment (EPopup *ep, EPopupItem *pitem, void *data)
GList *selected;
ECal *client;
char *new_uid;
+ icalproperty *prop;
selected = e_calendar_view_get_selected_events (cal_view);
if (!selected)
@@ -1300,6 +1317,9 @@ on_unrecur_appointment (EPopup *ep, EPopupItem *pitem, void *data)
the start & end times to the instances times. */
new_comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (new_comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+ if ((prop = icalcomponent_get_first_property (e_cal_component_get_icalcomponent (new_comp),
+ ICAL_RECURRENCEID_PROPERTY)))
+ icalcomponent_remove_property (e_cal_component_get_icalcomponent (new_comp), prop);
new_uid = e_cal_component_gen_uid ();
e_cal_component_set_uid (new_comp, new_uid);
g_free (new_uid);
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index f384fdbd66..c936342f74 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -601,7 +601,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem,
num_icons++;
}
- if (e_cal_component_has_recurrences (comp)) {
+ if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp)) {
draw_recurrence_icon = TRUE;
num_icons++;
}
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index a733a7ec17..c0f8c6b0d5 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -522,7 +522,7 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
icon_y = item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT
+ E_DAY_VIEW_ICON_Y_PAD - y;
- if (icon_x <= max_icon_x && e_cal_component_has_recurrences (comp)) {
+ if (icon_x <= max_icon_x && (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp))) {
gdk_gc_set_clip_mask (gc, NULL);
gdk_draw_pixbuf (drawable, gc,
day_view->recurrence_icon,
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index c5af654028..e7c924fb01 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -3486,7 +3486,7 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget,
cursor = day_view->normal_cursor;
/* Recurring events can't be resized. */
- if (event && !e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) {
+ if (event && !e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) {
switch (pos) {
case E_CALENDAR_VIEW_POS_LEFT_EDGE:
case E_CALENDAR_VIEW_POS_RIGHT_EDGE:
@@ -3854,16 +3854,37 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
e_cal_component_set_dtend (comp, &date);
}
+ e_cal_component_commit_sequence (comp);
if (e_cal_component_is_instance (comp)) {
if (!recur_component_dialog (client, comp, &mod, NULL)) {
gtk_widget_queue_draw (day_view->top_canvas);
goto out;
}
+
+ if (mod == CALOBJ_MOD_THIS) {
+ /* set the correct DTSTART/DTEND on the individual recurrence */
+ if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
+ *date.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_end, FALSE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+ e_cal_component_set_dtend (comp, &date);
+ } else {
+ *date.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_start, FALSE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+ e_cal_component_set_dtstart (comp, &date);
+ }
+
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+
+ e_cal_component_commit_sequence (comp);
+ }
}
toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
-
- e_cal_component_commit_sequence (comp);
e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE);
out:
@@ -3945,6 +3966,26 @@ e_day_view_finish_resize (EDayView *day_view)
gtk_widget_queue_draw (day_view->top_canvas);
goto out;
}
+
+ if (mod == CALOBJ_MOD_THIS) {
+ /* set the correct DTSTART/DTEND on the individual recurrence */
+ if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
+ *date.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_end, FALSE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+ e_cal_component_set_dtend (comp, &date);
+ } else {
+ *date.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_start, FALSE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+ e_cal_component_set_dtstart (comp, &date);
+ }
+
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+ }
}
toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
@@ -4281,7 +4322,7 @@ e_day_view_reshape_long_event (EDayView *day_view,
if (e_cal_component_has_alarms (comp))
num_icons++;
- if (e_cal_component_has_recurrences (comp))
+ if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp))
num_icons++;
if (event->different_timezone)
num_icons++;
@@ -4451,7 +4492,7 @@ e_day_view_reshape_day_event (EDayView *day_view,
if (e_cal_component_has_alarms (comp))
num_icons++;
- if (e_cal_component_has_recurrences (comp))
+ if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp))
num_icons++;
if (e_cal_component_has_attachments (comp))
num_icons++;
@@ -5820,6 +5861,13 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt
gtk_widget_queue_draw (day_view->top_canvas);
goto out;
}
+
+ if (mod == CALOBJ_MOD_THIS) {
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+ }
}
toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
@@ -6035,6 +6083,45 @@ e_day_view_on_editing_stopped (EDayView *day_view,
if (!recur_component_dialog (client, comp, &mod, NULL)) {
goto out;
}
+
+ if (mod == CALOBJ_MOD_THIS) {
+ ECalComponentDateTime dt;
+
+ e_cal_component_get_dtstart (comp, &dt);
+ if (dt.value->zone) {
+ *dt.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_start,
+ dt.value->is_date,
+ dt.value->zone);
+ } else {
+ *dt.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_start,
+ dt.value->is_date,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+ }
+ e_cal_component_set_dtstart (comp, &dt);
+
+ e_cal_component_get_dtend (comp, &dt);
+ if (dt.value->zone) {
+ *dt.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_end,
+ dt.value->is_date,
+ dt.value->zone);
+ } else {
+ *dt.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_end,
+ dt.value->is_date,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+ }
+ e_cal_component_set_dtend (comp, &dt);
+
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+
+ e_cal_component_commit_sequence (comp);
+ }
}
/* FIXME When sending here, what exactly should we send? */
@@ -6997,9 +7084,7 @@ e_day_view_on_drag_data_get (GtkWidget *widget,
vcal = e_cal_util_new_top_level ();
e_cal_util_add_timezones_from_component (vcal, event->comp_data->icalcomp);
- icalcomponent_add_component (
- vcal,
- icalcomponent_new_clone (event->comp_data->icalcomp));
+ icalcomponent_add_component (vcal, icalcomponent_new_clone (event->comp_data->icalcomp));
comp_str = icalcomponent_as_ical_string (vcal);
if (comp_str) {
@@ -7136,14 +7221,20 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
if (event->canvas_item)
gnome_canvas_item_show (event->canvas_item);
+ e_cal_component_commit_sequence (comp);
if (e_cal_component_is_instance (comp)) {
if (!recur_component_dialog (client, comp, &mod, NULL))
return;
+
+ if (mod == CALOBJ_MOD_THIS) {
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+ }
}
toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
- e_cal_component_commit_sequence (comp);
-
e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE);
g_object_unref (comp);
@@ -7325,16 +7416,22 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
if (event->canvas_item)
gnome_canvas_item_show (event->canvas_item);
+ e_cal_component_commit_sequence (comp);
if (e_cal_component_is_instance (comp)) {
if (!recur_component_dialog (client, comp, &mod, NULL)) {
g_object_unref (comp);
return;
}
+
+ if (mod == CALOBJ_MOD_THIS) {
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+ }
}
toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
- e_cal_component_commit_sequence (comp);
-
e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE);
g_object_unref (comp);
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index 13e2d14142..4bb3fe089a 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -615,7 +615,7 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem,
num_icons++;
}
- if (e_cal_component_has_recurrences (comp)) {
+ if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp)) {
draw_recurrence_icon = TRUE;
num_icons++;
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 684d278d84..36e81049e1 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -2581,7 +2581,7 @@ e_week_view_reshape_event_span (EWeekView *week_view,
if (e_cal_component_has_alarms (comp))
num_icons++;
- if (e_cal_component_has_recurrences (comp))
+ if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp))
num_icons++;
if (e_cal_component_has_attachments (comp))
num_icons++;
@@ -3193,6 +3193,13 @@ e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end
gtk_widget_queue_draw (week_view->main_canvas);
goto out;
}
+
+ if (mod == CALOBJ_MOD_THIS) {
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+ }
}
toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (week_view)));
@@ -3320,6 +3327,45 @@ e_week_view_on_editing_stopped (EWeekView *week_view,
if (!recur_component_dialog (client, comp, &mod, NULL)) {
goto out;
}
+
+ if (mod == CALOBJ_MOD_THIS) {
+ ECalComponentDateTime dt;
+
+ e_cal_component_get_dtstart (comp, &dt);
+ if (dt.value->zone) {
+ *dt.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_start,
+ dt.value->is_date,
+ dt.value->zone);
+ } else {
+ *dt.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_start,
+ dt.value->is_date,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+ }
+ e_cal_component_set_dtstart (comp, &dt);
+
+ e_cal_component_get_dtend (comp, &dt);
+ if (dt.value->zone) {
+ *dt.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_end,
+ dt.value->is_date,
+ dt.value->zone);
+ } else {
+ *dt.value = icaltime_from_timet_with_zone (
+ event->comp_data->instance_end,
+ dt.value->is_date,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+ }
+ e_cal_component_set_dtend (comp, &dt);
+
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+
+ e_cal_component_commit_sequence (comp);
+ }
}
/* FIXME When sending here, what exactly should we send? */