evolution-data-server r9945 - in branches/gnome-2-24/calendar: . backends/caldav backends/file backends/groupwise



Author: mcrha
Date: Fri Jan 16 11:43:46 2009
New Revision: 9945
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9945&view=rev

Log:
2009-01-16  Milan Crha  <mcrha redhat com>

	** Fix for bug #360813

	* backends/file/e-cal-backend-file.c:
	(e_cal_backend_file_create_object),
	(e_cal_backend_file_modify_object),
	(e_cal_backend_file_receive_objects):
	* backends/groupwise/e-cal-backend-groupwise-utils.c:
	(e_gw_item_to_cal_component):
	* backends/caldav/e-cal-backend-caldav.c: (caldav_create_object),
	(caldav_modify_object), (process_object):
	RFC 2445 - CREATED/DTSTAMP/LAST-MODIFIED always in UTC.



Modified:
   branches/gnome-2-24/calendar/ChangeLog
   branches/gnome-2-24/calendar/backends/caldav/e-cal-backend-caldav.c
   branches/gnome-2-24/calendar/backends/file/e-cal-backend-file.c
   branches/gnome-2-24/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c

Modified: branches/gnome-2-24/calendar/backends/caldav/e-cal-backend-caldav.c
==============================================================================
--- branches/gnome-2-24/calendar/backends/caldav/e-cal-backend-caldav.c	(original)
+++ branches/gnome-2-24/calendar/backends/caldav/e-cal-backend-caldav.c	Fri Jan 16 11:43:46 2009
@@ -1844,7 +1844,7 @@
 	}
 
 	/* Set the created and last modified times on the component */
-	current = icaltime_from_timet (time (NULL), 0);
+	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
 	e_cal_component_set_created (comp, &current);
 	e_cal_component_set_last_modified (comp, &current);
 
@@ -1927,7 +1927,7 @@
 	}
 
 	/* Set the last modified time on the component */
-	current = icaltime_from_timet (time (NULL), 0);
+	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
 	e_cal_component_set_last_modified (comp, &current);
 
 	/* sanitize the component*/
@@ -2135,7 +2135,7 @@
 	backend = E_CAL_BACKEND (cbdav);
 
 	/* ctime, mtime */
-	now = icaltime_from_timet (time (NULL), 0);
+	now = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
 	e_cal_component_set_created (ecomp, &now);
 	e_cal_component_set_last_modified (ecomp, &now);
 

Modified: branches/gnome-2-24/calendar/backends/file/e-cal-backend-file.c
==============================================================================
--- branches/gnome-2-24/calendar/backends/file/e-cal-backend-file.c	(original)
+++ branches/gnome-2-24/calendar/backends/file/e-cal-backend-file.c	Fri Jan 16 11:43:46 2009
@@ -1857,7 +1857,7 @@
 	e_cal_component_set_icalcomponent (comp, icalcomp);
 
 	/* Set the created and last modified times on the component */
-	current = icaltime_from_timet (time (NULL), 0);
+	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
 	e_cal_component_set_created (comp, &current);
 	e_cal_component_set_last_modified (comp, &current);
 
@@ -1963,7 +1963,7 @@
 	e_cal_component_set_icalcomponent (comp, icalcomp);
 
 	/* Set the last modified time on the component */
-	current = icaltime_from_timet (time (NULL), 0);
+	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
 	e_cal_component_set_last_modified (comp, &current);
 
 	/* sanitize the component*/
@@ -2567,7 +2567,7 @@
 		e_cal_component_set_icalcomponent (comp, subcomp);
 
 		/* Set the created and last modified times on the component */
-		current = icaltime_from_timet (time (NULL), 0);
+		current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
 		e_cal_component_set_created (comp, &current);
 		e_cal_component_set_last_modified (comp, &current);
 

Modified: branches/gnome-2-24/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
==============================================================================
--- branches/gnome-2-24/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	(original)
+++ branches/gnome-2-24/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	Fri Jan 16 11:43:46 2009
@@ -1085,18 +1085,13 @@
 	t = e_gw_item_get_creation_date (item);
 	if (t) {
 		itt_utc = icaltime_from_string (t);
-		if (!icaltime_get_timezone (itt_utc))
-			icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone());
-		if (default_zone) {
-			itt = icaltime_convert_to_zone (itt_utc, default_zone);
-			icaltime_set_timezone (&itt, default_zone);
-			e_cal_component_set_created (comp, &itt);
-			e_cal_component_set_dtstamp (comp, &itt);
 
-		} else {
-			e_cal_component_set_created (comp, &itt_utc);
-			e_cal_component_set_dtstamp (comp, &itt_utc);
-		}
+		/* RFC 2445 - CREATED/DTSTAMP/LAST-MODIFIED always in UTC */
+		icaltimezone_convert_time (&itt_utc, (icaltimezone*) icaltime_get_timezone (itt_utc), icaltimezone_get_utc_timezone ());
+		icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone ());
+
+		e_cal_component_set_created (comp, &itt_utc);
+		e_cal_component_set_dtstamp (comp, &itt_utc);
 	}
 
 	/* categories */



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