diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2002-08-06 22:09:18 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2002-08-06 22:09:18 +0800 |
commit | 8f6536de284ed25c263ac7ac2a4b1c840e71da7f (patch) | |
tree | 1339f815ad4e0958f69efa3deed4885bf80d29cd /calendar/pcs/query.c | |
parent | 1402b68e05a1f701bed2a9cb377fe02cbe69109e (diff) | |
download | gsoc2013-evolution-8f6536de284ed25c263ac7ac2a4b1c840e71da7f.tar.gz gsoc2013-evolution-8f6536de284ed25c263ac7ac2a4b1c840e71da7f.tar.zst gsoc2013-evolution-8f6536de284ed25c263ac7ac2a4b1c840e71da7f.zip |
new function. (query_backend_get_uids): new function. (query_backend_new):
2002-08-05 Rodrigo Moya <rodrigo@ximian.com>
* pcs/query-backend.[ch] (query_backend_get_object_component): new
function.
(query_backend_get_uids): new function.
(query_backend_new): create the static GHashTable if it hasn't been
created yet.
(query_backend_destroy): destroy the static GHashTable if empty.
(foreach_uid_cb): call object_updated_cb, which does everything.
* pcs/query.c: make use of the new QueryBackend class.
(query_init): initialize new private structure member.
(query_destroy): clean up new member, without freeing it, since it is
managed internally in query-backend.c.
(query_construct): create a QueryBackend for the query.
svn path=/trunk/; revision=17713
Diffstat (limited to 'calendar/pcs/query.c')
-rw-r--r-- | calendar/pcs/query.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/calendar/pcs/query.c b/calendar/pcs/query.c index 8e952a5727..8ecd3445cd 100644 --- a/calendar/pcs/query.c +++ b/calendar/pcs/query.c @@ -35,6 +35,7 @@ #include <cal-util/timeutil.h> #include "cal-backend.h" #include "query.h" +#include "query-backend.h" @@ -52,6 +53,9 @@ struct _QueryPrivate { /* The backend we are monitoring */ CalBackend *backend; + /* The cache backend */ + QueryBackend *qb; + /* The default timezone for the calendar. */ icaltimezone *default_zone; @@ -122,6 +126,7 @@ query_init (Query *query) query->priv = priv; priv->backend = NULL; + priv->qb = NULL; priv->default_zone = NULL; priv->ql = CORBA_OBJECT_NIL; priv->sexp = NULL; @@ -175,6 +180,8 @@ query_destroy (GtkObject *object) priv->backend = NULL; } + priv->qb = NULL; + if (priv->ql != CORBA_OBJECT_NIL) { CORBA_Environment ev; @@ -1120,7 +1127,7 @@ match_component (Query *query, const char *uid, g_assert (priv->state == QUERY_IN_PROGRESS || priv->state == QUERY_DONE); g_assert (priv->esexp != NULL); - comp = cal_backend_get_object_component (priv->backend, uid); + comp = query_backend_get_object_component (priv->qb, uid); if (!comp) return; @@ -1302,7 +1309,7 @@ start_query (Query *query) /* Populate the query with UIDs so that we can process them asynchronously */ priv->state = QUERY_IN_PROGRESS; - priv->pending_uids = cal_backend_get_uids (priv->backend, CALOBJ_TYPE_ANY); + priv->pending_uids = query_backend_get_uids (priv->qb, CALOBJ_TYPE_ANY); priv->pending_total = g_list_length (priv->pending_uids); priv->n_pending = priv->pending_total; @@ -1406,6 +1413,7 @@ query_construct (Query *query, priv->backend = backend; gtk_object_ref (GTK_OBJECT (priv->backend)); + priv->qb = query_backend_new (query, backend); priv->default_zone = cal_backend_get_default_timezone (backend); priv->sexp = g_strdup (sexp); |