[evolution-data-server] Put the component into the cache after inserting into interval tree. Store comps in interval tree ba
- From: Chenthill Palanisamy <pchen src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Put the component into the cache after inserting into interval tree. Store comps in interval tree ba
- Date: Thu, 9 Sep 2010 06:54:15 +0000 (UTC)
commit 9cbfcc0352a81512f85bb5e13a06507fea22ed42
Author: Punit Jain <jpunit novell com>
Date: Thu Sep 9 12:22:01 2010 +0530
Put the component into the cache after inserting into interval tree. Store comps in interval tree based on just uid for non-recurring events
calendar/libedata-cal/e-cal-backend-file-store.c | 1 +
calendar/libedata-cal/e-cal-backend-intervaltree.c | 7 +++++--
calendar/libedata-cal/e-cal-backend-store.c | 8 ++++----
3 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/calendar/libedata-cal/e-cal-backend-file-store.c b/calendar/libedata-cal/e-cal-backend-file-store.c
index 0fe0017..20df8d8 100644
--- a/calendar/libedata-cal/e-cal-backend-file-store.c
+++ b/calendar/libedata-cal/e-cal-backend-file-store.c
@@ -685,6 +685,7 @@ scan_vcalendar (ECalBackendStore *store, icalcomponent *top_icalcomp)
e_cal_util_get_component_occur_times (comp, &time_start, &time_end,
resolve_tzid, store, dzone, kind);
+ put_component (fstore, comp);
e_cal_backend_store_interval_tree_add_comp (store, comp, time_start, time_end);
g_object_unref (comp);
diff --git a/calendar/libedata-cal/e-cal-backend-intervaltree.c b/calendar/libedata-cal/e-cal-backend-intervaltree.c
index 8323d56..09c7897 100644
--- a/calendar/libedata-cal/e-cal-backend-intervaltree.c
+++ b/calendar/libedata-cal/e-cal-backend-intervaltree.c
@@ -92,7 +92,10 @@ get_direction (EIntervalNode *x, time_t z_start, time_t z_end)
static inline gchar *
component_key(const gchar *uid, const gchar *rid)
{
- return g_strdup_printf("%s_%s", uid, rid);
+ if (rid)
+ return g_strdup_printf("%s_%s", uid, rid);
+ else
+ return g_strdup_printf("%s", uid);
}
/**
@@ -633,7 +636,7 @@ e_intervaltree_remove (EIntervalTree *tree,
if (!z || z == nil)
{
g_message (G_STRLOC ": Cannot remove node - could not find node in tree\n");
- g_static_rec_mutex_unlock (&priv->mutex);
+ g_static_rec_mutex_unlock (&priv->mutex);
return FALSE;
}
diff --git a/calendar/libedata-cal/e-cal-backend-store.c b/calendar/libedata-cal/e-cal-backend-store.c
index 1b4e76d..1cbd060 100644
--- a/calendar/libedata-cal/e-cal-backend-store.c
+++ b/calendar/libedata-cal/e-cal-backend-store.c
@@ -252,8 +252,8 @@ e_cal_backend_store_put_component_with_time_range (ECalBackendStore *store, ECal
priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if ((E_CAL_BACKEND_STORE_GET_CLASS (store))->put_component (store, comp)) {
- e_intervaltree_insert (priv->intervaltree, occurence_start, occurence_end, comp);
- return TRUE;
+ if (e_intervaltree_insert (priv->intervaltree, occurence_start, occurence_end, comp))
+ return TRUE;
}
return FALSE;
@@ -291,8 +291,8 @@ e_cal_backend_store_remove_component (ECalBackendStore *store, const gchar *uid,
priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if ((E_CAL_BACKEND_STORE_GET_CLASS (store))->remove_component (store, uid, rid)) {
- e_intervaltree_remove (priv->intervaltree, uid, rid);
- return TRUE;
+ if (e_intervaltree_remove (priv->intervaltree, uid, rid))
+ return TRUE;
}
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]