[evolution-patches] patch to fix gui becoming inresponsive while movin from offline to online [calendar]



Hi,
  Have attached the patch for the same.

thanks, chenthill.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.436
diff -u -p -r1.436 ChangeLog
--- ChangeLog	8 Mar 2005 07:59:47 -0000	1.436
+++ ChangeLog	12 Mar 2005 11:13:32 -0000
@@ -1,3 +1,17 @@
+2005-03-12  Chenthill Palanisamy  <pchenthill novell com>
+
+	* backends/groupwise/e-cal-backend-groupwise.c:
+	(connect_to_server): Run the get deltas in a thread to
+	avoid the inresponsiveness of the GUI when evolution
+	changes mode from offline to online.
+
 2005-03-08  Chenthill Palanisamy  <pchenthill novell com>
 
 	Fixes #73141
Index: backends/groupwise/e-cal-backend-groupwise.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise.c,v
retrieving revision 1.136
diff -u -p -r1.136 e-cal-backend-groupwise.c
--- backends/groupwise/e-cal-backend-groupwise.c	28 Feb 2005 18:23:14 -0000	1.136
+++ backends/groupwise/e-cal-backend-groupwise.c	12 Mar 2005 11:13:32 -0000
@@ -551,18 +551,22 @@ connect_to_server (ECalBackendGroupwise 
 
 		if (priv->cnc && priv->cache) {
 			priv->mode = CAL_MODE_REMOTE;
-			
-			if (priv->mode_changed && !priv->timeout_id) {
+			if (priv->mode_changed && !priv->timeout_id && (e_cal_backend_get_kind (E_CAL_BACKEND (cbgw)) == ICAL_VEVENT_COMPONENT)) {
+				GThread *thread1;
 				priv->mode_changed = FALSE;
-				if (get_deltas (cbgw)) {
-					if (e_cal_backend_get_kind (E_CAL_BACKEND (cbgw)) == ICAL_VEVENT_COMPONENT)
-						priv->timeout_id = g_timeout_add (CACHE_REFRESH_INTERVAL, (GSourceFunc) get_deltas, (gpointer) cbgw);
-				} else {
-					g_warning (G_STRLOC ": Could not populate the cache");
-					return GNOME_Evolution_Calendar_PermissionDenied;	
+
+				thread1 = g_thread_create ((GThreadFunc) get_deltas, cbgw, FALSE, &error);
+				if (!thread1) {
+					g_warning (G_STRLOC ": %s", error->message);
+					g_error_free (error);
+
+					e_cal_backend_notify_error (E_CAL_BACKEND (cbgw), _("Could not create thread for getting deltas"));
+					return GNOME_Evolution_Calendar_OtherError;
 				}
-			}	 
+				priv->timeout_id = g_timeout_add (CACHE_REFRESH_INTERVAL, (GSourceFunc) get_deltas, (gpointer) cbgw);
 
+			}
+	
 			return GNOME_Evolution_Calendar_Success;
 		}
 		priv->mode_changed = FALSE;


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