evolution-data-server r9525 - in branches/eds-dbus/calendar: . backends/google



Author: rbradford
Date: Thu Sep 11 20:38:19 2008
New Revision: 9525
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9525&view=rev

Log:
2008-09-11  Milan Crha  <mcrha redhat com>

	** Fix for bug #551805

	* backends/google/e-cal-backend-google-utils.c:
	(e_cal_backend_google_utils_create_cache):
	Create new timeout source only when none set yet.
	* backends/google/e-cal-backend-google-utils.h:
	* backends/google/e-cal-backend-google-utils.c:
	(e_cal_backend_google_utils_update): Honour function prototype.
	* backends/google/e-cal-backend-google-utils.c:
	(e_cal_backend_google_utils_connect): Honour return data type.
	* backends/google/e-cal-backend-google.h:
	* backends/google/e-cal-backend-google.c:
	(struct _ECalBackendGooglePrivate),
	(e_cal_backend_google_set_timeout_id),
	(e_cal_backend_google_get_timeout_id): Honour return data type.

Modified:
   branches/eds-dbus/calendar/ChangeLog
   branches/eds-dbus/calendar/backends/google/e-cal-backend-google-utils.c
   branches/eds-dbus/calendar/backends/google/e-cal-backend-google-utils.h
   branches/eds-dbus/calendar/backends/google/e-cal-backend-google.c
   branches/eds-dbus/calendar/backends/google/e-cal-backend-google.h

Modified: branches/eds-dbus/calendar/backends/google/e-cal-backend-google-utils.c
==============================================================================
--- branches/eds-dbus/calendar/backends/google/e-cal-backend-google-utils.c	(original)
+++ branches/eds-dbus/calendar/backends/google/e-cal-backend-google-utils.c	Thu Sep 11 20:38:19 2008
@@ -132,7 +132,6 @@
 e_cal_backend_google_utils_create_cache (ECalBackendGoogle *cbgo)
 {
 	ESource *source;
-	guint timeout_id;
 	int x;
 	const gchar *refresh_interval = NULL;
 	ECalBackendCache *cache;
@@ -152,10 +151,14 @@
 	else
 		x = 30;
 
-	timeout_id = g_timeout_add (x * 60000,
-				  (GSourceFunc) get_deltas_timeout,
-				  (gpointer)cbgo);
-	e_cal_backend_google_set_timeout_id (cbgo, timeout_id);
+	if (!e_cal_backend_google_get_timeout_id (cbgo)) {
+		guint timeout_id;
+
+		timeout_id = g_timeout_add (x * 60000,
+					  (GSourceFunc) get_deltas_timeout,
+					  (gpointer)cbgo);
+		e_cal_backend_google_set_timeout_id (cbgo, timeout_id);
+	}
 
 	return GINT_TO_POINTER (GNOME_Evolution_Calendar_Success);
 }
@@ -169,7 +172,7 @@
  *
  * Return value: TRUE if update is successful FALSE otherwise .
  **/
-gboolean
+gpointer
 e_cal_backend_google_utils_update (gpointer handle)
 {
 	ECalBackendGoogle *cbgo;
@@ -187,9 +190,9 @@
 	gboolean needs_to_insert = FALSE;
 	gchar *uri;
 
-	if (!handle) {
+	if (!handle || !E_IS_CAL_BACKEND_GOOGLE (handle)) {
 		g_critical ("\n Invalid handle %s", G_STRLOC);
-		return FALSE;
+		return NULL;
 	}
 
 	g_static_mutex_lock (&updating);
@@ -264,7 +267,7 @@
 	}
 
 	g_static_mutex_unlock (&updating);
-	return TRUE;
+	return NULL;
 }
 
 ECalBackendSyncStatus
@@ -283,7 +286,7 @@
 	GError *error = NULL;
 	GThread *thread;
 	gchar *username, *password;
-	gint timeout_id;
+	guint timeout_id;
 	gboolean mode_changed;
 	gchar *uri, *suri;
 

Modified: branches/eds-dbus/calendar/backends/google/e-cal-backend-google-utils.h
==============================================================================
--- branches/eds-dbus/calendar/backends/google/e-cal-backend-google-utils.h	(original)
+++ branches/eds-dbus/calendar/backends/google/e-cal-backend-google-utils.h	Thu Sep 11 20:38:19 2008
@@ -42,7 +42,7 @@
 EGoItem *
 e_go_item_from_cal_component (ECalBackendGoogle *cbgo, ECalComponent *comp);
 
-gboolean
+gpointer
 e_cal_backend_google_utils_update (gpointer handle);
 
 GDataEntry *

Modified: branches/eds-dbus/calendar/backends/google/e-cal-backend-google.c
==============================================================================
--- branches/eds-dbus/calendar/backends/google/e-cal-backend-google.c	(original)
+++ branches/eds-dbus/calendar/backends/google/e-cal-backend-google.c	Thu Sep 11 20:38:19 2008
@@ -73,7 +73,7 @@
 	CalMode	mode;
 	EGoItem *item;
 
-	gint timeout_id;
+	guint timeout_id;
 	gchar *username;
 	gchar *password;
 	gchar *uri;
@@ -1544,7 +1544,7 @@
  *
  **/
 void
-e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo,gint timeout_id )
+e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo, guint timeout_id)
 {
 	ECalBackendGooglePrivate *priv;
 	priv = cbgo->priv;
@@ -1689,7 +1689,7 @@
  * Gets the timeout id.
  *
  **/
-gint
+guint
 e_cal_backend_google_get_timeout_id (ECalBackendGoogle *cbgo)
 {
 	ECalBackendGooglePrivate *priv;

Modified: branches/eds-dbus/calendar/backends/google/e-cal-backend-google.h
==============================================================================
--- branches/eds-dbus/calendar/backends/google/e-cal-backend-google.h	(original)
+++ branches/eds-dbus/calendar/backends/google/e-cal-backend-google.h	Thu Sep 11 20:38:19 2008
@@ -73,7 +73,7 @@
 gchar * e_cal_backend_google_get_username (ECalBackendGoogle *cbgo);
 gchar * e_cal_backend_google_get_password (ECalBackendGoogle *cbgo);
 gchar * e_cal_backend_google_get_local_attachments_store (ECalBackendGoogle *cbgo);
-gint e_cal_backend_google_get_timeout_id (ECalBackendGoogle *cbgo);
+guint e_cal_backend_google_get_timeout_id (ECalBackendGoogle *cbgo);
 
 void e_cal_backend_google_set_entry (ECalBackendGoogle *cbgo, GDataEntry *entry);
 void e_cal_backend_google_set_cache (ECalBackendGoogle *cbgo, ECalBackendCache *cache);
@@ -84,7 +84,7 @@
 void e_cal_backend_google_set_mode_changed (ECalBackendGoogle *cbgo, gboolean mode_changed);
 void e_cal_backend_google_set_username (ECalBackendGoogle *cbgo, gchar *username);
 void e_cal_backend_google_set_password (ECalBackendGoogle *cbgo, gchar *password);
-void e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo,gint timeout_id);
+void e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo, guint timeout_id);
 
 G_END_DECLS
 #endif



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