[evolution-couchdb] Use e_book_backend_get_cache_dir to get the correct dir for the cache



commit d81cdf705ae9178e3edaca4f272dde838f632949
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Wed Apr 6 13:19:19 2011 +0200

    Use e_book_backend_get_cache_dir to get the correct dir for the cache

 addressbook/e-book-backend-couchdb.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/e-book-backend-couchdb.c b/addressbook/e-book-backend-couchdb.c
index ccad894..cb31918 100644
--- a/addressbook/e-book-backend-couchdb.c
+++ b/addressbook/e-book-backend-couchdb.c
@@ -987,7 +987,8 @@ e_book_backend_couchdb_load_source (EBookBackend *backend,
 				    gboolean only_if_exists)
 #endif
 {
-	gchar *uri;
+	gchar *uri, *cache_filename;
+	const gchar *cache_dir;
 	const gchar *property;
 	GError *error = NULL;
 	GSList *doc_list, *sl;
@@ -1100,9 +1101,13 @@ e_book_backend_couchdb_load_source (EBookBackend *backend,
 	}
 
 	/* Create cache */
-	uri = e_source_get_uri (source);
-	couchdb_backend->cache = e_book_backend_cache_new ((const gchar *) uri);
-	g_free (uri);
+	cache_dir = e_book_backend_get_cache_dir (E_BOOK_BACKEND (couchdb_backend));
+	cache_filename = g_build_filename (cache_dir,
+					   couchdb_session_get_uri (couchdb_backend->couchdb),
+					   "cache.xml", NULL);
+	g_debug ("Creating cache at %s", cache_filename);
+	couchdb_backend->cache = e_book_backend_cache_new ((const gchar *) cache_filename);
+	g_free (cache_filename);
 
 	/* Populate the cache */
 	e_file_cache_clean (E_FILE_CACHE (couchdb_backend->cache));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]