diff options
author | Not Zed <NotZed@HelixCode.com> | 2000-05-31 06:35:40 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-05-31 06:35:40 +0800 |
commit | 631dda8ae0829b1fb7b503348de541e3fe2027c5 (patch) | |
tree | b809428b7c6e01cf6bce0513b7ab20f436b0352a /camel/camel-store.c | |
parent | a9ddc24118d91139784cb0ce99789a739fdc5978 (diff) | |
download | gsoc2013-evolution-631dda8ae0829b1fb7b503348de541e3fe2027c5.tar gsoc2013-evolution-631dda8ae0829b1fb7b503348de541e3fe2027c5.tar.gz gsoc2013-evolution-631dda8ae0829b1fb7b503348de541e3fe2027c5.tar.bz2 gsoc2013-evolution-631dda8ae0829b1fb7b503348de541e3fe2027c5.tar.lz gsoc2013-evolution-631dda8ae0829b1fb7b503348de541e3fe2027c5.tar.xz gsoc2013-evolution-631dda8ae0829b1fb7b503348de541e3fe2027c5.tar.zst gsoc2013-evolution-631dda8ae0829b1fb7b503348de541e3fe2027c5.zip |
Init filter_from to NULL, for exception case. (mbox_get_message_by_uid):
2000-05-30 Not Zed <NotZed@HelixCode.com>
* providers/mbox/camel-mbox-folder.c (mbox_append_message): Init
filter_from to NULL, for exception case.
(mbox_get_message_by_uid): Cast off_t to long int for diagnostics.
* camel-url.c (camel_url_hash): Hash funciton for using camel
url's as hash keys.
(camel_url_equal): equal function for same.
* camel-session.c (camel_session_finalise): Free cached services.
(camel_session_init): Init service cache.
(service_cache_remove): destroy callback to remove a service from
the cache.
* camel-store.c (get_folder_internal): Remove the extra ref of the
folder. That seems the right behaviour ...?
(camel_store_get_type): Doh, actually call store init, so the
cache works.
(cache_folder): strdup the folder name! no wonder it never found
it again.
svn path=/trunk/; revision=3298
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r-- | camel/camel-store.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c index 87384a61d4..b4eae9975e 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -90,7 +90,7 @@ camel_store_get_type (void) sizeof (CamelStore), sizeof (CamelStoreClass), (GtkClassInitFunc) camel_store_class_init, - (GtkObjectInitFunc) NULL, + (GtkObjectInitFunc) camel_store_init, /* reserved_1 */ NULL, /* reserved_2 */ NULL, (GtkClassInitFunc) NULL, @@ -166,7 +166,7 @@ cache_folder (CamelStore *store, const char *folder_name, CamelFolder *folder) g_warning ("Caching folder %s that already exists.", folder_name); } - g_hash_table_insert (store->folders, (gpointer)folder_name, folder); + g_hash_table_insert (store->folders, (gpointer)g_strdup(folder_name), folder); gtk_signal_connect_object (GTK_OBJECT (folder), "destroy", GTK_SIGNAL_FUNC (CS_CLASS (store)->uncache_folder), GTK_OBJECT (store)); @@ -175,6 +175,7 @@ cache_folder (CamelStore *store, const char *folder_name, CamelFolder *folder) static void uncache_folder (CamelStore *store, CamelFolder *folder) { + /* FIXME: free name index */ g_hash_table_remove (store->folders, camel_folder_get_full_name (folder)); } @@ -186,18 +187,25 @@ get_folder_internal (CamelStore *store, const char *folder_name, { CamelFolder *folder = NULL; + printf("Getting folder %p '%s'\n", store, folder_name); /* Try cache first. */ folder = CS_CLASS (store)->lookup_folder (store, folder_name); + if (folder) { + printf("Folder cached!\n"); + } else { + printf("Folder not cached!\n"); + } + if (!folder) { folder = CS_CLASS (store)->get_folder (store, folder_name, ex); if (!folder) return NULL; + printf("storing folder in cache: %p '%s'\n", store, folder_name); CS_CLASS (store)->cache_folder (store, folder_name, folder); } - gtk_object_ref (GTK_OBJECT (folder)); return folder; } |