aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2003-05-20 01:06:16 +0800
committerJP Rosevear <jpr@src.gnome.org>2003-05-20 01:06:16 +0800
commite4795863516716eedb9e3bcafd4ce62c0cca1e23 (patch)
tree08fffff7035fc07cc28ab80bffcff3a59dc351cc /calendar/gui/gnome-cal.c
parent3a4478a2993f740cc008b0eac609f33768275048 (diff)
downloadgsoc2013-evolution-e4795863516716eedb9e3bcafd4ce62c0cca1e23.tar.gz
gsoc2013-evolution-e4795863516716eedb9e3bcafd4ce62c0cca1e23.tar.zst
gsoc2013-evolution-e4795863516716eedb9e3bcafd4ce62c0cca1e23.zip
remove the query time out if its still alive (update_query_timeout):
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 svn path=/trunk/; revision=21257
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 6dc44e5e78..6b8c87b575 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -109,7 +109,8 @@ struct _GnomeCalendarPrivate {
/* 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 @@ gnome_calendar_destroy (GtkObject *object)
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 @@ permission_error (GnomeCalendar *gcal, const char *uri)
}
/* 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 @@ client_cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer da
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. */