diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2008-09-29 04:53:01 +0000 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2008-09-29 04:53:01 +0000 |
commit | 1541ee22933eccaa8c441cef128bbcaa8b1b4254 (patch) | |
tree | 62f4099c6fbd930f5444ac559f566b4ec481cfe5 /camel/camel-store.c | |
parent | 149bb73ff7941b443a0b54be057d1ffc5e37f0ba (diff) | |
download | evolution-data-server-db-summary-v2.tar.gz |
DBv2. Folders work. vfolders too, but need lot of optimization.db-summary-v2
svn path=/branches/db-summary-v2/; revision=9625
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r-- | camel/camel-store.c | 49 |
1 files changed, 6 insertions, 43 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c index a1e702799..51f0fc6a1 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -163,7 +163,10 @@ camel_store_finalize (CamelObject *object) camel_db_close (store->cdb); store->cdb = NULL; } - + if (store->cdb_write) { + camel_db_close (store->cdb_write); + store->cdb_write = NULL; + } g_free (store->priv); } @@ -212,48 +215,8 @@ construct (CamelService *service, CamelSession *session, if (camel_exception_is_set (ex)) return; - store_db_path = g_build_filename (service->url->path, CAMEL_DB_FILE, NULL); - - if (!service->url->path || strlen (store_db_path) < 2) { - store_path = camel_session_get_storage_path (session, service, ex); - - g_free (store_db_path); - store_db_path = g_build_filename (store_path, CAMEL_DB_FILE, NULL); - } - - if (!g_file_test (service->url->path ? service->url->path : store_path, G_FILE_TEST_EXISTS)) { - /* Cache might be blown. Recreate. */ - g_mkdir_with_parents (service->url->path ? service->url->path : store_path, S_IRWXU); - } - - g_free (store_path); - - store->cdb = camel_db_open (store_db_path, ex); - printf("store_db_path %s\n", store_db_path); - if (camel_exception_is_set (ex)) { - char *store_path; - - g_print ("Failure for store_db_path : [%s]\n", store_db_path); - g_free (store_db_path); - - store_path = camel_session_get_storage_path (session, service, ex); - store_db_path = g_build_filename (store_path, CAMEL_DB_FILE, NULL); - g_free (store_path); - camel_exception_clear(ex); - store->cdb = camel_db_open (store_db_path, ex); - if (camel_exception_is_set (ex)) { - g_print("Retry with %s failed\n", store_db_path); - g_free(store_db_path); - camel_exception_clear(ex); - return; - } - } - g_free (store_db_path); - - if (camel_db_create_folders_table (store->cdb, ex)) - printf ("something went wrong terribly\n"); - else - printf ("folders table successfully created \n"); + store->cdb = camel_db_get_handle (ex); + store->cdb_write = camel_db_get_handle (ex); if (camel_exception_is_set (ex)) return; |