aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-10-31 20:49:54 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-10-31 20:49:54 +0800
commit3f2c88fd0f1c284881b5d63655850619017185d9 (patch)
treee1945f1597b745090e9b672559dc01b13c65367a /calendar
parent6adebda32b45285db49b9337da08b61f09ad80b7 (diff)
downloadgsoc2013-evolution-3f2c88fd0f1c284881b5d63655850619017185d9.tar.gz
gsoc2013-evolution-3f2c88fd0f1c284881b5d63655850619017185d9.tar.zst
gsoc2013-evolution-3f2c88fd0f1c284881b5d63655850619017185d9.zip
If a query is not in progress, just retag the whole thing. An event may
2001-10-31 Federico Mena Quintero <federico@ximian.com> * gui/gnome-cal.c (dn_query_obj_updated_cb): If a query is not in progress, just retag the whole thing. An event may change dates and tag_calendar_by_comp() would not know how to untag the old dates. Fixes bug #10220. * pcs/query.c (start_query_cb): Connect to the backend's "obj_updated" and "obj_removed" signals here instead of in query_construct(). If a query is started while another one is notifying of an update, these signal connections would get appened to the running signal (the one that triggered the notification about an update) and the new signal handlers would also get called. We are really not interested in updates before we populate the query, because we'll catch the changes anyways. svn path=/trunk/; revision=14533
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog16
-rw-r--r--calendar/gui/gnome-cal.c10
-rw-r--r--calendar/pcs/query.c82
3 files changed, 67 insertions, 41 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 239496f4b0..8ac62c4900 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,21 @@
2001-10-31 Federico Mena Quintero <federico@ximian.com>
+ * gui/gnome-cal.c (dn_query_obj_updated_cb): If a query is not in
+ progress, just retag the whole thing. An event may change dates
+ and tag_calendar_by_comp() would not know how to untag the old
+ dates. Fixes bug #10220.
+
+ * pcs/query.c (start_query_cb): Connect to the backend's
+ "obj_updated" and "obj_removed" signals here instead of in
+ query_construct(). If a query is started while another one is
+ notifying of an update, these signal connections would get appened
+ to the running signal (the one that triggered the notification
+ about an update) and the new signal handlers would also get
+ called. We are really not interested in updates before we
+ populate the query, because we'll catch the changes anyways.
+
+2001-10-31 Federico Mena Quintero <federico@ximian.com>
+
Fix bug #13723.
* gui/gnome-cal.h (GnomeCalendarClass): New signals
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 1912068208..98c01e6372 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -303,6 +303,16 @@ dn_query_obj_updated_cb (CalQuery *query, const char *uid,
gcal = GNOME_CALENDAR (data);
priv = gcal->priv;
+ /* If this is an update that is not part of an ongoing query, we have to
+ * retag the whole thing: an event may change dates and the
+ * tag_calendar_by_comp() below would not know how to untag the old
+ * dates.
+ */
+ if (!query_in_progress) {
+ update_query (gcal);
+ return;
+ }
+
status = cal_client_get_object (priv->client, uid, &comp);
switch (status) {
diff --git a/calendar/pcs/query.c b/calendar/pcs/query.c
index 28513d3822..33289ed107 100644
--- a/calendar/pcs/query.c
+++ b/calendar/pcs/query.c
@@ -1265,6 +1265,40 @@ populate_query (Query *query)
priv->state = QUERY_IN_PROGRESS;
}
+/* Callback used when a component changes in the backend */
+static void
+backend_obj_updated_cb (CalBackend *backend, const char *uid, gpointer data)
+{
+ Query *query;
+
+ query = QUERY (data);
+
+ bonobo_object_ref (BONOBO_OBJECT (query));
+
+ match_component (query, uid, FALSE, 0, 0);
+ remove_from_pending (query, uid);
+
+ bonobo_object_unref (BONOBO_OBJECT (query));
+}
+
+/* Callback used when a component is removed from the backend */
+static void
+backend_obj_removed_cb (CalBackend *backend, const char *uid, gpointer data)
+{
+ Query *query;
+ QueryPrivate *priv;
+
+ query = QUERY (data);
+ priv = query->priv;
+
+ bonobo_object_ref (BONOBO_OBJECT (query));
+
+ remove_component (query, uid);
+ remove_from_pending (query, uid);
+
+ bonobo_object_unref (BONOBO_OBJECT (query));
+}
+
/* Idle handler for starting a query */
static gboolean
start_query_cb (gpointer data)
@@ -1284,6 +1318,13 @@ start_query_cb (gpointer data)
populate_query (query);
+ gtk_signal_connect (GTK_OBJECT (priv->backend), "obj_updated",
+ GTK_SIGNAL_FUNC (backend_obj_updated_cb),
+ query);
+ gtk_signal_connect (GTK_OBJECT (priv->backend), "obj_removed",
+ GTK_SIGNAL_FUNC (backend_obj_removed_cb),
+ query);
+
return FALSE;
}
@@ -1307,40 +1348,6 @@ backend_opened_cb (CalBackend *backend, CalBackendOpenStatus status, gpointer da
}
}
-/* Callback used when a component changes in the backend */
-static void
-backend_obj_updated_cb (CalBackend *backend, const char *uid, gpointer data)
-{
- Query *query;
-
- query = QUERY (data);
-
- bonobo_object_ref (BONOBO_OBJECT (query));
-
- match_component (query, uid, FALSE, 0, 0);
- remove_from_pending (query, uid);
-
- bonobo_object_unref (BONOBO_OBJECT (query));
-}
-
-/* Callback used when a component is removed from the backend */
-static void
-backend_obj_removed_cb (CalBackend *backend, const char *uid, gpointer data)
-{
- Query *query;
- QueryPrivate *priv;
-
- query = QUERY (data);
- priv = query->priv;
-
- bonobo_object_ref (BONOBO_OBJECT (query));
-
- remove_component (query, uid);
- remove_from_pending (query, uid);
-
- bonobo_object_unref (BONOBO_OBJECT (query));
-}
-
/**
* query_construct:
* @query: A live search query.
@@ -1388,13 +1395,6 @@ query_construct (Query *query,
priv->default_zone = cal_backend_get_default_timezone (backend);
- gtk_signal_connect (GTK_OBJECT (priv->backend), "obj_updated",
- GTK_SIGNAL_FUNC (backend_obj_updated_cb),
- query);
- gtk_signal_connect (GTK_OBJECT (priv->backend), "obj_removed",
- GTK_SIGNAL_FUNC (backend_obj_removed_cb),
- query);
-
priv->sexp = g_strdup (sexp);
/* Queue the query to be started asynchronously */