aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/query.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/pcs/query.c')
-rw-r--r--calendar/pcs/query.c12
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);