Re: [evolution-patches] 41890



On Mon, 2003-05-19 at 12:27, JP Rosevear wrote:
> Hopefully this fixes the problem
> 
> -JP

Updated so we don't call update_query twice upon opening.

-JP
-- 
JP Rosevear <jpr ximian com>
Ximian, Inc.
? 41890.patch
? 43103.patch
? leak.patch
? utf8-title.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1772
diff -u -r1.1772 ChangeLog
--- ChangeLog	19 May 2003 15:21:42 -0000	1.1772
+++ ChangeLog	19 May 2003 16:39:49 -0000
@@ -1,5 +1,12 @@
 2003-05-19  JP Rosevear  <jpr ximian com>
 
+	* gui/gnome-cal.c (gnome_calendar_destroy): remove the query time
+	out if its still alive
+	(update_query_timeout): update the query and clear the time out
+	(client_cal_opened_cb): add the query update timeout
+
+2003-05-19  JP Rosevear  <jpr ximian com>
+	
 	Fixes #43103
 	
 	* gui/e-day-view.c (e_day_view_init): connect normally instead of
Index: gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.240
diff -u -r1.240 gnome-cal.c
--- gui/gnome-cal.c	14 May 2003 18:45:55 -0000	1.240
+++ gui/gnome-cal.c	19 May 2003 16:39:50 -0000
@@ -109,7 +109,8 @@
 	/* Calendar query for the date navigator */
 	CalQuery    *dn_query;
 	char        *sexp;
-
+	guint        query_timeout;
+	
 	/* This is the view currently shown. We use it to keep track of the
 	   positions of the panes. range_selected is TRUE if a range of dates
 	   was selected in the date navigator to show the view. */
@@ -940,6 +941,11 @@
 			priv->sexp = NULL;
 		}
 
+		if (priv->query_timeout) {
+			g_source_remove (priv->query_timeout);
+			priv->query_timeout = 0;
+		}
+	
 		if (priv->client) {
 			g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA,
 							      0, 0, NULL, NULL, gcal);
@@ -1507,6 +1513,21 @@
 }
 
 /* Callback from the calendar client when a calendar is loaded */
+static gboolean
+update_query_timeout (gpointer data)
+{
+	GnomeCalendar *gcal = data;
+	GnomeCalendarPrivate *priv;
+
+	gcal = GNOME_CALENDAR (data);
+	priv = gcal->priv;
+
+	update_query (gcal);
+	priv->query_timeout = 0;
+
+	return FALSE;
+}
+
 static void
 client_cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data)
 {
@@ -1522,7 +1543,7 @@
 	case CAL_CLIENT_OPEN_SUCCESS:
 		/* If this is the main CalClient, update the Date Navigator. */
 		if (client == priv->client) {
-			update_query (gcal);
+			priv->query_timeout = g_timeout_add (100, update_query_timeout, gcal);
 		}
 
 		/* Set the client's default timezone, if we have one. */


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