[evolution-patches] 56517



Slightly more granular checking so that not "adding" the UTC zone is not
an error and the error responses are correct.

-JP
-- 
JP Rosevear <jpr ximian com>
Novell, Inc.
? zone.patch
? libecal/temp.c
? libical/src/libicalss/icalssyacc.output
? libical/src/python/LibicalWrap.c
? libical/src/python/LibicalWrap_wrap.doc
? libical/src/python/Makefile
? libical/src/python/Makefile.in
? libical/src/test/clusterin.vcd
? libical/src/test/store
? libical/src/test/store-new
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.241
diff -u -r1.241 ChangeLog
--- ChangeLog	12 Apr 2004 06:53:50 -0000	1.241
+++ ChangeLog	15 Apr 2004 19:10:29 -0000
@@ -1,3 +1,8 @@
+2004-04-15  JP Rosevear  <jpr ximian com>
+
+	* libecal/e-cal.c (e_cal_add_timezone): do a little more sanity
+	checking on what we send
+
 2004-04-12  Sarfraaz Ahmed <asarfraaz novell com>
 
 	Fixes #56517
Index: idl/Evolution-DataServer-Calendar.idl
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/idl/Evolution-DataServer-Calendar.idl,v
retrieving revision 1.5
diff -u -r1.5 Evolution-DataServer-Calendar.idl
--- idl/Evolution-DataServer-Calendar.idl	1 Mar 2004 15:45:57 -0000	1.5
+++ idl/Evolution-DataServer-Calendar.idl	15 Apr 2004 19:10:29 -0000
@@ -243,7 +243,7 @@
 		oneway void notifyQuery (in CallStatus status, in CalView query);
 
 		oneway void notifyTimezoneRequested (in CallStatus status, in CalTimezoneObj tz);
-		oneway void notifyTimezoneAdded (in CallStatus status, in CalTimezoneObjUID tzid);
+		oneway void notifyTimezoneAdded (in CallStatus status, in CalTimezoneObj object);
 		oneway void notifyDefaultTimezoneSet (in CallStatus status);
 
 		oneway void notifyChanges (in CallStatus status, in CalObjChangeSeq changes);
Index: libecal/e-cal.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal.c,v
retrieving revision 1.54
diff -u -r1.54 e-cal.c
--- libecal/e-cal.c	12 Apr 2004 06:53:50 -0000	1.54
+++ libecal/e-cal.c	15 Apr 2004 19:10:29 -0000
@@ -3781,10 +3781,6 @@
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 	e_return_error_if_fail (izone, E_CALENDAR_STATUS_INVALID_ARG);
 	
-	icalcomp = icaltimezone_get_component (izone);
-
-	e_return_error_if_fail (icalcomp, FALSE);
-	
 	priv = ecal->priv;
 
 	g_mutex_lock (priv->mutex);
@@ -3805,7 +3801,26 @@
 
 	g_mutex_unlock (priv->mutex);
 
-	/* convert icaltimezone into a string */
+	/* Make sure we have a valid component - UTC doesn't, nor do
+	 * we really have to add it */
+	if (izone == icaltimezone_get_utc_timezone ()) {
+		e_calendar_remove_op (ecal, our_op);
+		g_mutex_unlock (our_op->mutex);
+		e_calendar_free_op (our_op);
+		
+		E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_OK, error);
+	}
+	
+	icalcomp = icaltimezone_get_component (izone);
+	if (!icalcomp) {
+		e_calendar_remove_op (ecal, our_op);
+		g_mutex_unlock (our_op->mutex);
+		e_calendar_free_op (our_op);
+
+		E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_INVALID_ARG, error);
+	}
+
+	/* convert icaltimezone into a string */	
 	tzobj = icalcomponent_as_ical_string (icalcomp);
 
 	/* call the backend */


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