Fix for the bugs #329566, #329568, #329570 [calendar]

chen <[email protected]>
Newsgroups gmane.comp.gnome.evolution.patches
Message-ID <[email protected]>
Hi,
  Have attached the patches which fixes the mentioned bugs. Sets the
instance dates of the master object. Sets the exception dates properly
in the master object while deleting detached instances. 

thanks, Chenthill.

_______________________________________________
Evolution-patches mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-patches
eds_patch.diff (text/x-patch, 2.6 KB)
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.557
diff -u -p -u -p -r1.557 ChangeLog
--- ChangeLog	23 Jan 2006 14:12:19 -0000	1.557
+++ ChangeLog	2 Feb 2006 10:41:42 -0000
@@ -1,3 +1,12 @@
+2006-02-02  Chenthill Palanisamy  <[email protected]>
+
+	Fixes #329566, #329568
+	* backends/file/e-cal-backend-file.c:
+	(e_cal_backend_file_modify_object): Reset the instance dates of the 
+	master object if its a recurring event.
+       	(remove_instance): Removed the return statement so that the exception is
+	set in the master object.
+	
 2006-01-23  Veerapuram Varadhan <[email protected]>
  
  	** Fixes #327427
Index: backends/file/e-cal-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/file/e-cal-backend-file.c,v
retrieving revision 1.70
diff -u -p -u -p -r1.70 e-cal-backend-file.c
--- backends/file/e-cal-backend-file.c	10 Jan 2006 07:55:33 -0000	1.70
+++ backends/file/e-cal-backend-file.c	2 Feb 2006 10:41:43 -0000
@@ -1959,6 +1959,29 @@ e_cal_backend_file_modify_object (ECalBa
 	case CALOBJ_MOD_ALL :
 		/* in this case, we blow away all recurrences, and start over
 		   with a clean component */
+
+		if (e_cal_util_component_has_recurrences (icalcomp) && rid && *rid) {
+			icaltimetype start, recur = icaltime_from_string (rid);
+
+			start = icalcomponent_get_dtstart (icalcomp);
+
+			/* This means its a instance generated from master object. So replace 
+			    the dates stored dates from the master object */
+			   
+			if (icaltime_compare (start, recur)) {
+				ECalComponentDateTime m_sdate, m_endate;
+
+				e_cal_component_get_dtstart (obj_data->full_object, &m_sdate);
+				e_cal_component_get_dtend (obj_data->full_object, &m_endate);
+
+				e_cal_component_set_dtstart (comp, &m_sdate);
+				e_cal_component_set_dtend (comp, &m_endate);
+				e_cal_component_set_recurid (comp, NULL);
+				e_cal_component_commit_sequence (comp);
+			}
+			*new_object = e_cal_component_get_as_string (comp);
+		}
+		
 		/* Remove the old version */
 		if (old_object)
 			*old_object = e_cal_component_get_as_string (obj_data->full_object);
@@ -1991,8 +2014,6 @@ remove_instance (ECalBackendFile *cbfile
 		cbfile->priv->comp = g_list_remove (cbfile->priv->comp, comp);
 		obj_data->recurrences_list = g_list_remove (obj_data->recurrences_list, comp);
 		g_hash_table_remove (obj_data->recurrences, rid);
-
-		return;
 	}
 
 	/* remove the component from our data, temporarily */
evo_patch.diff (text/x-patch, 2.9 KB)
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2973
diff -u -p -u -p -r1.2973 ChangeLog
--- ChangeLog	31 Jan 2006 09:12:12 -0000	1.2973
+++ ChangeLog	2 Feb 2006 10:37:02 -0000
@@ -1,3 +1,10 @@
+2006-02-02  Chenthill Palanisamy  <[email protected]>
+
+	Fixes #329570
+	* gui/e-calendar-view.c: (on_unrecur_appointment):
+	Just remove the instances pass the rid. The exception
+	date will be set in the backend.
+
 2006-01-31  Tor Lillqvist  <[email protected]>
 
 	* gui/alarm-notify/alarm-queue.c (open_alarm_dialog,
Index: gui/e-calendar-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-view.c,v
retrieving revision 1.114
diff -u -p -u -p -r1.114 e-calendar-view.c
--- gui/e-calendar-view.c	23 Jan 2006 06:45:03 -0000	1.114
+++ gui/e-calendar-view.c	2 Feb 2006 10:37:03 -0000
@@ -1475,7 +1475,8 @@ on_unrecur_appointment (EPopup *ep, EPop
 	GList *selected;
 	ECal *client;
 	char *new_uid;
-
+	ECalComponentId *id = NULL;
+	
 	selected = e_calendar_view_get_selected_events (cal_view);
 	if (!selected)
 		return;
@@ -1491,13 +1492,9 @@ on_unrecur_appointment (EPopup *ep, EPop
 
 	comp = e_cal_component_new ();
 	e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-	
-	if (e_cal_component_has_recurrences (comp)) {
-		e_cal_component_set_recurid (comp, NULL);
-		cal_comp_util_add_exdate (comp, event->comp_data->instance_start, e_calendar_view_get_timezone (cal_view));
-		e_cal_component_commit_sequence (comp);
-	}
+	id = e_cal_component_get_id (comp);
 
+	
 	/* For the unrecurred instance we duplicate the original object,
 	   create a new uid for it, get rid of the recurrence rules, and set
 	   the start & end times to the instances times. */
@@ -1527,17 +1524,12 @@ on_unrecur_appointment (EPopup *ep, EPop
 	/* Now update both ECalComponents. Note that we do this last since at
 	 * present the updates happen synchronously so our event may disappear.
 	 */
-	if (e_cal_component_has_recurrences (comp)) {
-	if (!e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), CALOBJ_MOD_ALL, NULL))
-		g_message ("on_unrecur_appointment(): Could not update the object!");
-	} else {
-		ECalComponentId *id = e_cal_component_get_id (comp);
 		
-		if (!e_cal_remove_object_with_mod (client, id->uid, id->rid, CALOBJ_MOD_THIS,
-					NULL));
-			g_message ("on_unrecur_appointment(): Could not remove the old object!");
-	}
+	if (!e_cal_remove_object_with_mod (client, id->uid, id->rid, CALOBJ_MOD_THIS,
+				NULL))
+		g_message ("on_unrecur_appointment(): Could not remove the old object!");
 
+	e_cal_component_free_id (id);
 	g_object_unref (comp);
 
 	if (!e_cal_create_object (client, e_cal_component_get_icalcomponent (new_comp), &new_uid, NULL))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.