[evolution-patches] [calendar] patch for async auth



This patch prevents the idle callback to be called more than once.
? mkinstalldirs
? libical/src/libicalss/icalssyacc.output
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.293
diff -u -p -r1.293 ChangeLog
--- ChangeLog	5 Jul 2004 06:21:48 -0000	1.293
+++ ChangeLog	9 Jul 2004 16:02:03 -0000
@@ -1,3 +1,8 @@
+2004-07-09  Rodrigo Moya <rodrigo novell com>
+
+	* libecal/e-cal.c (async_auth_idle_cb): remove the idle callback so
+	that it doesn't get called more than once.
+
 2004-06-28  Chenthill Palanisamy <pchenthill novell com>
 	
 	Fixes #60463
Index: libecal/e-cal.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal.c,v
retrieving revision 1.68
diff -u -p -r1.68 e-cal.c
--- libecal/e-cal.c	2 Jun 2004 16:15:00 -0000	1.68
+++ libecal/e-cal.c	9 Jul 2004 16:02:05 -0000
@@ -1586,6 +1586,7 @@ typedef struct {
 	char *password;
 	GMutex *mutex;
 	GCond *cond;
+	guint idle_id;
 } ECalAsyncData;
 
 static gboolean
@@ -1593,6 +1594,9 @@ async_auth_idle_cb (gpointer data)
 {
 	ECalAsyncData *ccad = data;
 
+	g_source_remove (ccad->idle_id);
+	ccad->idle_id = -1;
+
 	g_mutex_lock (ccad->mutex);
 	ccad->password = ccad->real_auth_func (ccad->ecal, ccad->auth_prompt, ccad->auth_key, ccad->real_auth_user_data);
 	g_cond_signal (ccad->cond);
@@ -1629,7 +1633,7 @@ async_auth_func_cb (ECal *ecal, const ch
 	ccad->auth_prompt = prompt;
 	ccad->auth_key = key;
 
-	g_idle_add ((GSourceFunc) async_auth_idle_cb, ccad);
+	ccad->idle_id = g_idle_add ((GSourceFunc) async_auth_idle_cb, ccad);
 		
 	g_mutex_lock (ccad->mutex);
 	g_cond_wait (ccad->cond, ccad->mutex);
@@ -1639,7 +1643,6 @@ async_auth_func_cb (ECal *ecal, const ch
 
 	return password;
 }
-
 
 static gpointer
 open_async (gpointer data) 


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