evolution-data-server r8556 - in trunk/calendar: . backends/google



Author: jensg
Date: Wed Mar  5 20:53:30 2008
New Revision: 8556
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8556&view=rev

Log:
2008-03-05  Jens Granseuer  <jensgr gmx net>

	** Fixes bug #520362

	* backends/google/e-cal-backend-google-utils.c:
	(e_cal_backend_google_utils_create_cache),
	(e_go_item_to_cal_component), (e_go_item_from_cal_component),
	(gd_date_to_ical):
	* backends/google/e-cal-backend-google.c: (receive_object),
	(e_cal_backend_google_modify_object),
	(e_cal_backend_google_create_object): put all declarations at the
	beginnings of code blocks to make older compilers happy


Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/backends/google/e-cal-backend-google-utils.c
   trunk/calendar/backends/google/e-cal-backend-google.c

Modified: trunk/calendar/backends/google/e-cal-backend-google-utils.c
==============================================================================
--- trunk/calendar/backends/google/e-cal-backend-google-utils.c	(original)
+++ trunk/calendar/backends/google/e-cal-backend-google-utils.c	Wed Mar  5 20:53:30 2008
@@ -151,8 +151,10 @@
 
 	if (refresh_interval)
 		x = atoi (refresh_interval);
+	else
+		x = 30;
 
-	timeout_id = g_timeout_add ((refresh_interval ? x : 30) * 60000,
+	timeout_id = g_timeout_add (x * 60000,
 				  (GSourceFunc) get_deltas_timeout,
 				  (gpointer)cbgo);
 	e_cal_backend_google_set_timeout_id (cbgo, timeout_id);
@@ -406,6 +408,7 @@
 	const char *description, *uid, *temp;
 	struct icaltimetype itt_utc, itt;
 	GSList *category_ids;
+	GSList *go_attendee_list = NULL, *l = NULL, *attendee_list = NULL;
 
 	comp = e_cal_component_new ();
 	default_zone = e_cal_backend_google_get_default_zone (cbgo);
@@ -484,16 +487,17 @@
 	e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
 
 	/* Attendees */
-	GSList *go_attendee_list = NULL, *l = NULL, *attendee_list = NULL;
 	go_attendee_list = gdata_entry_get_attendee_list (item->entry);
 		
 	if (go_attendee_list != NULL) {
 
 		for (l = go_attendee_list; l != NULL; l = l->next) {
 			Attendee *go_attendee;
+			ECalComponentAttendee *attendee;
+
 			go_attendee = (Attendee *)l->data;
 
-			ECalComponentAttendee *attendee = g_new0 (ECalComponentAttendee, 1);
+			attendee = g_new0 (ECalComponentAttendee, 1);
 #if 0
 			_print_attendee ((Attendee *)l->data);
 #endif
@@ -598,10 +602,12 @@
 	icaltimetype itt;
 	const char *uid;
 	const char *location;
-
-	priv = cbgo->priv;
 	GSList *list = NULL;
 	GDataEntry *entry;
+	ECalComponentText *t;
+	GSList *attendee_list = NULL, *l = NULL;
+
+	priv = cbgo->priv;
 
 	item = g_new0 (EGoItem, 1);
 	entry = gdata_entry_new ();
@@ -629,7 +635,6 @@
 
 	/* Content / Description */
 	e_cal_component_get_description_list (comp, &list);
-	ECalComponentText *t;
 	if (list != NULL) {
 		t = (ECalComponentText *)list->data;
 		gdata_entry_set_content (entry, t->value);
@@ -652,7 +657,6 @@
 			"label",
 			term);
 	/* Attendee */
-	GSList *attendee_list = NULL, *l = NULL;
 	e_cal_component_get_attendee_list (comp, &attendee_list);
 
 	for (l = attendee_list; l!=NULL; l=l->next) {
@@ -880,9 +884,10 @@
 gd_date_to_ical (gchar *string)
 {
 	gchar *s, *str;
+	int count = 0;
+
 	s = g_strdup (string);
 	str = string;
-	int count = 0;
 
 	g_return_val_if_fail (string != NULL, "");
 

Modified: trunk/calendar/backends/google/e-cal-backend-google.c
==============================================================================
--- trunk/calendar/backends/google/e-cal-backend-google.c	(original)
+++ trunk/calendar/backends/google/e-cal-backend-google.c	Wed Mar  5 20:53:30 2008
@@ -544,7 +544,7 @@
 	GSList *comps = NULL, *l = NULL;
 	icalproperty_method method;
 	icalproperty *icalprop;
-	gboolean instances = TRUE, found;
+	gboolean instances = TRUE, found = FALSE;
 	icalparameter_partstat pstatus = 0;
 
 	priv = cbgo->priv;
@@ -889,6 +889,7 @@
 	const char *uid=NULL, *rid=NULL;
 	GDataEntry *entry, *entry_from_server=NULL;
 	gchar *edit_link;
+	GSList *l;
 
 	*old_object = NULL;
 	cbgo = E_CAL_BACKEND_GOOGLE (backend);
@@ -911,7 +912,6 @@
 	e_cal_component_get_uid (comp, &uid);
 
 	/* Check if object exists */
-	GSList *l;
 	switch (priv->mode) {
 		case CAL_MODE_ANY:
 		case CAL_MODE_REMOTE:
@@ -1075,13 +1075,13 @@
 	switch (priv->mode) {
 
 		case CAL_MODE_ANY:
-		case CAL_MODE_REMOTE:
+		case CAL_MODE_REMOTE: {
 			/* Create an appointment */
+			GDataEntry *updated_entry;
 
 			item = e_go_item_from_cal_component (cbgo, comp);
 			entry = e_go_item_get_entry (item);
 
-			GDataEntry *updated_entry;
 			updated_entry = gdata_service_insert_entry (GDATA_SERVICE(priv->service), priv->uri, entry);
 			if (!GDATA_IS_ENTRY (updated_entry)) {
 				g_message ("\n Entry Insertion Failed %s \n", G_STRLOC);
@@ -1090,7 +1090,7 @@
 			id = gdata_entry_get_id (updated_entry);
 			e_cal_component_set_uid (comp, id);
 
-			break;
+			break; }
 		default:
 			break;
 	}



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