evolution-data-server r10210 - in trunk/calendar: . libedata-cal



Author: pchen
Date: Mon Apr 13 08:45:47 2009
New Revision: 10210
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=10210&view=rev

Log:
2009-04-13  Chenthill Palanisamy  <pchenthill novell com>

	Fixes #573205
	* calendar/libedata-cal/e-cal-backend-sync.c: Use the util function
	to load the system timezone if its not part of libical builtin timezone.

Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/libedata-cal/e-cal-backend-sync.c

Modified: trunk/calendar/libedata-cal/e-cal-backend-sync.c
==============================================================================
--- trunk/calendar/libedata-cal/e-cal-backend-sync.c	(original)
+++ trunk/calendar/libedata-cal/e-cal-backend-sync.c	Mon Apr 13 08:45:47 2009
@@ -11,6 +11,7 @@
 #endif
 
 #include "e-cal-backend-sync.h"
+#include <icaltz-util.h>
 
 struct _ECalBackendSyncPrivate {
 	GMutex *sync_mutex;
@@ -892,25 +893,35 @@
 		}
 
 		if (slashes == 1) {
+			icalcomponent *icalcomp = NULL, *free_comp = NULL;
+
 			icaltimezone *zone = icaltimezone_get_builtin_timezone (tzid);
+			if (!zone) {
+				/* Try fetching the timezone from zone directory. There are some timezones like MST, US/Pacific etc. which do not appear in
+				zone.tab, so they will not be available in the libical builtin timezone */
+				icalcomp = free_comp = icaltzutil_fetch_timezone (tzid);
+			}
+
+			if (zone)
+				icalcomp = icaltimezone_get_component (zone);
 
-			if (zone) {
-				icalcomponent *icalcomp = icaltimezone_get_component (zone);
+			if (icalcomp) {
+				icalcomponent *clone = icalcomponent_new_clone (icalcomp);
+				icalproperty *prop;
+
+				prop = icalcomponent_get_first_property (clone, ICAL_TZID_PROPERTY);
+				if (prop) {
+					/* change tzid to our, because the component has the buildin tzid */
+					icalproperty_set_tzid (prop, tzid);
 
-				if (icalcomp) {
-					icalcomponent *clone = icalcomponent_new_clone (icalcomp);
-					icalproperty *prop;
-
-					prop = icalcomponent_get_first_property (clone, ICAL_TZID_PROPERTY);
-					if (prop) {
-						/* change tzid to our, because the component has the buildin tzid */
-						icalproperty_set_tzid (prop, tzid);
-
-						object = icalcomponent_as_ical_string_r (clone);
-					}
-					icalcomponent_free (clone);
+					object = icalcomponent_as_ical_string_r (clone);
+					status = GNOME_Evolution_Calendar_Success;
 				}
+				icalcomponent_free (clone);
 			}
+			
+			if (free_comp)	
+				icalcomponent_free (free_comp);
 		}
 
 		/* also cache this timezone to backend */



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