Re: [evolution-patches] fix for the bug 74227 [exchange calendar]



Removed the check for the if (object) and changed the other callers not
to send NULL for this argument. 

thanks, chenthill.

On Thu, 2005-03-31 at 12:04 +0530, Sushma Rai wrote:
> Looks fine.
> The condition check "if (object)" is redundant.
> Also we need to look at removing one instance case.
> 
> -Sushma.
> 
> 
> On Thu, 2005-03-31 at 10:34 +0530, chenthill wrote:
> > Hi,
> >  Have attached the fix for the bug.
> > 
> > thanks, chenthill.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-exchange/ChangeLog,v
retrieving revision 1.312
diff -u -p -r1.312 ChangeLog
--- ChangeLog	31 Mar 2005 05:27:24 -0000	1.312
+++ ChangeLog	31 Mar 2005 06:29:09 -0000
@@ -1,5 +1,14 @@
 2005-03-31  Chenthill Palanisamy  <pchenthill novell com>
 
+	Fixes #74227
+	* calendar/e-cal-backend-exchange-calendar.c
+       	(remove_object): Removed the check for the presence of object 
+	and assign proper values to old_object and object.
+	(receive_objects), (book_resource): Do not send NULL for the 
+	last argument in remove_object
+	
+2005-03-31  Chenthill Palanisamy  <pchenthill novell com>
+
 	Fixes #73929
 	* calendar/e-cal-backend-exchange-calendar.c: (receive_objects): If the 
 	rid is not present and the method is CANCEL remove the recurrence event
Index: calendar/e-cal-backend-exchange-calendar.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/calendar/e-cal-backend-exchange-calendar.c,v
retrieving revision 1.41
diff -u -p -r1.41 e-cal-backend-exchange-calendar.c
--- calendar/e-cal-backend-exchange-calendar.c	31 Mar 2005 04:54:12 -0000	1.41
+++ calendar/e-cal-backend-exchange-calendar.c	31 Mar 2005 06:29:09 -0000
@@ -1207,8 +1207,7 @@ remove_object (ECalBackendSync *backend,
 		
 	comp = e_cal_component_new ();
 	e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (ecomp->icomp));
-	if(object)
-		*object = e_cal_component_get_as_string (comp);
+	*old_object = e_cal_component_get_as_string (comp);
 	
 	switch (mod) {
 		
@@ -1223,6 +1222,7 @@ remove_object (ECalBackendSync *backend,
 						return GNOME_Evolution_Calendar_Success;
 				}
 			}
+			*object = NULL;
 			break;
 		case CALOBJ_MOD_THIS:
 			/*remove_instance and modify */
@@ -1320,11 +1320,12 @@ receive_objects (ECalBackendSync *backen
 			break;
 
 		case ICAL_METHOD_CANCEL:
+			char *object = NULL;
 			calobj = (char *) icalcomponent_as_ical_string (subcomp);
 			if (rid)
-				status = remove_object (backend, cal, uid, rid, CALOBJ_MOD_THIS, &calobj, NULL);
+				status = remove_object (backend, cal, uid, rid, CALOBJ_MOD_THIS, &calobj, &object);
 			else
-				status = remove_object (backend, cal, uid, NULL, CALOBJ_MOD_ALL, &calobj, NULL);
+				status = remove_object (backend, cal, uid, NULL, CALOBJ_MOD_ALL, &calobj, &object);
 			if (status == GNOME_Evolution_Calendar_Success) 
 				e_cal_backend_notify_object_removed (E_CAL_BACKEND (backend), uid, calobj, NULL);
 			break;
@@ -1457,6 +1458,8 @@ book_resource (ECalBackendExchange *cbex
 	ecomp = get_exchange_comp (E_CAL_BACKEND_EXCHANGE (cbex), uid);
 												 
 	if (method == ICAL_METHOD_CANCEL) {
+		char *object = NULL;
+		
 		/* g_object_unref (comp); */
 		/* If there is nothing to cancel, we're good */
 		if (!ecomp) {
@@ -1478,7 +1481,7 @@ book_resource (ECalBackendExchange *cbex
 		e_cal_component_set_transparency (E_CAL_COMPONENT (comp), E_CAL_COMPONENT_TRANSP_TRANSPARENT);
 		calobj = (char *) e_cal_component_get_as_string (comp);
 		rid = (char *) e_cal_component_get_recurid_as_string (comp);
-		status = remove_object (E_CAL_BACKEND_SYNC (cbex), cal, uid, rid, CALOBJ_MOD_THIS, &calobj, NULL);
+		status = remove_object (E_CAL_BACKEND_SYNC (cbex), cal, uid, rid, CALOBJ_MOD_THIS, &calobj, &object);
 		e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbex), uid, calobj, NULL);
 		g_free (calobj); 
 	} else {


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