[evolution-data-server] Remove the key if the value is NULL.
- From: Chenthill Palanisamy <pchen src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Remove the key if the value is NULL.
- Date: Thu, 9 Sep 2010 06:39:56 +0000 (UTC)
commit 11efe67979ab5589f204b50deda90c0edeefe7ab
Author: Chenthill Palanisamy <pchenthill novell com>
Date: Thu Sep 9 12:07:10 2010 +0530
Remove the key if the value is NULL.
calendar/libedata-cal/e-cal-backend-file-store.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/calendar/libedata-cal/e-cal-backend-file-store.c b/calendar/libedata-cal/e-cal-backend-file-store.c
index 0c4b860..0fe0017 100644
--- a/calendar/libedata-cal/e-cal-backend-file-store.c
+++ b/calendar/libedata-cal/e-cal-backend-file-store.c
@@ -381,10 +381,14 @@ e_cal_backend_file_store_put_key_value (ECalBackendStore *store, const gchar *ke
g_static_rw_lock_writer_lock (&priv->lock);
- if (e_file_cache_get_object (priv->keys_cache, key))
- ret_val = e_file_cache_replace_object (priv->keys_cache, key, value);
- else
- ret_val = e_file_cache_add_object (priv->keys_cache, key, value);
+ if (!value)
+ ret_val = e_file_cache_remove_object (priv->keys_cache, key);
+ else {
+ if (e_file_cache_get_object (priv->keys_cache, key))
+ ret_val = e_file_cache_replace_object (priv->keys_cache, key, value);
+ else
+ ret_val = e_file_cache_add_object (priv->keys_cache, key, value);
+ }
g_static_rw_lock_writer_unlock (&priv->lock);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]