[evolution-patches] Fixes for GW calendar issues



hi,

 The following is a fix for a couple of issues that is preventing the
correct display of GW calendar items in the UI. 

1) The tm structure holds the no. of years from 1900 and not the
absolute year value. The range for the month is zero-based.
2) Timezone should be set to UTC while returning the ecal_component.

Harish

Index: servers/groupwise/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/ChangeLog,v
retrieving revision 1.8
diff -u -p -r1.8 ChangeLog
--- servers/groupwise/ChangeLog	2 Mar 2004 11:11:53 -0000	1.8
+++ servers/groupwise/ChangeLog	4 Mar 2004 16:41:10 -0000
@@ -1,3 +1,9 @@
+2004-03-04 Harish K <kharish novell com>
+	* e-gw-connection.c : (timet_from_string):
+	1900 should be subtracted from the year value and 1 from the 
+	month value in struct tm. Added include for ctype.h to remove
+	compiler warning.	
+
 2004-03-02 Sivaiah Nallagatla <snallagatla novell com>
 
 	* doc/gw-soap-types.xml :
Index: servers/groupwise/e-gw-connection.c
===================================================================
RCS file:
/cvs/gnome/evolution-data-server/servers/groupwise/e-gw-connection.c,v
retrieving revision 1.55
diff -u -p -r1.55 e-gw-connection.c
--- servers/groupwise/e-gw-connection.c	26 Feb 2004 15:53:00 -0000	1.55
+++ servers/groupwise/e-gw-connection.c	4 Mar 2004 16:41:10 -0000
@@ -25,6 +25,7 @@
 #include <config.h>
 #endif
 #include <string.h>
+#include <ctype.h>
 #include <libsoup/soup-session-sync.h>
 #include <libsoup/soup-soap-message.h>
 #include "e-gw-connection.h"
@@ -798,15 +799,15 @@ timet_from_string (const char *str)
 	date.tm_year = digit_at (str, 0) * 1000
                 + digit_at (str, 1) * 100
                 + digit_at (str, 2) * 10
-                + digit_at (str, 3);
-        date.tm_mon = digit_at (str, 4) * 10 + digit_at (str, 5);
+                + digit_at (str, 3) -1900;
+        date.tm_mon = digit_at (str, 4) * 10 + digit_at (str, 5) -1;
         date.tm_mday = digit_at (str, 6) * 10 + digit_at (str, 7);
         if (len > 8) {
                 date.tm_hour = digit_at (str, 9) * 10 + digit_at (str,
10);
                 date.tm_min  = digit_at (str, 11) * 10 + digit_at (str,
12);
                 date.tm_sec  = digit_at (str, 13) * 10 + digit_at (str,
14);
         } else
-		date.tm_hour = date.tm_min = date.tm_sec = 0;
+		date.tm_hour = date.tm_min = date.tm_sec = 0; 
 
 	return mktime (&date);
 }
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.197
diff -u -p -r1.197 ChangeLog
--- calendar/ChangeLog	2 Mar 2004 22:48:54 -0000	1.197
+++ calendar/ChangeLog	4 Mar 2004 16:41:11 -0000
@@ -1,3 +1,8 @@
+2004-03-04 Harish K <kharish novell com>
+	* backends/groupwise/e-cal-backend-groupwise-utils.c :
+	timezone values in ECalDateComponent structures should be
+	set to "UTC" for GW items.
+	
 2004-03-01  Rodrigo Moya <rodrigo ximian com>
 
 	Fixes #33243
Index: calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
===================================================================
RCS file:
/cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c,v
retrieving revision 1.2
diff -u -p -r1.2 e-cal-backend-groupwise-utils.c
--- calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	6 Feb
2004 18:52:50 -0000	1.2
+++ calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	4 Mar
2004 16:41:11 -0000
@@ -242,12 +242,14 @@ e_gw_item_to_cal_component (EGwItem *ite
 	t = e_gw_item_get_start_date (item);
 	itt = icaltime_from_timet (t, 0);
 	dt.value = &itt;
+	dt.tzid = g_strdup ("UTC");
 	e_cal_component_set_dtstart (comp, &dt);
 
 	/* end date */
 	t = e_gw_item_get_end_date (item);
 	itt = icaltime_from_timet (t, 0);
 	dt.value = &itt;
+	dt.tzid = g_strdup ("UTC");
 	e_cal_component_set_dtend (comp, &dt);
 
 	/* classification */





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