From df8180e04abf2efd32ca0624484df5b35e564759 Mon Sep 17 00:00:00 2001 From: Jason Leach Date: Mon, 13 Aug 2001 21:36:41 +0000 Subject: Fix this so it can actually get folders from the hash of folders on the 2001-08-13 Jason Leach * mail-local.c (get_folder): Fix this so it can actually get folders from the hash of folders on the local store (it was looking up plain @folder_name, which is typically "mbox", instead of the full URI, /home/jleach/evolution/local/Foo/mbox). * component-factory.c (do_remove_folder): Rename to remove_folder_done, more fitting for it's purpose. (do_xfer_folder): Similar name change. (do_create_folder): Similar name change. (remove_folder): Don't notifyResult for the component here, we will notify with our result in remove_folder_done. (xfer_folder): Ditto. * mail-vfolder.c (vfolder_refresh): Create new folders with unread counts of "0" instead of #FALSE (which just happens to be #defined as zero). svn path=/trunk/; revision=11964 --- mail/mail-local.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'mail/mail-local.c') diff --git a/mail/mail-local.c b/mail/mail-local.c index 8602e4acb7..c3a5e5723f 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -310,23 +310,30 @@ mail_local_store_get_type (void) } static CamelFolder * -get_folder (CamelStore *store, const char *folder_name, - guint32 flags, CamelException *ex) +get_folder (CamelStore *store, + const char *folder_name, + guint32 flags, + CamelException *ex) { MailLocalStore *local_store = (MailLocalStore *)store; CamelFolder *folder; MailLocalFolder *local_folder; - - local_folder = g_hash_table_lookup (local_store->folders, folder_name); + char *name; + + name = g_strconcat (CAMEL_SERVICE (store)->url->path, folder_name, NULL); + + local_folder = g_hash_table_lookup (local_store->folders, name); + if (local_folder) { folder = local_folder->folder; camel_object_ref (CAMEL_OBJECT (folder)); } else { folder = NULL; camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - _("No such folder %s"), folder_name); + _("No such folder %s"), name); } - + + g_free (name); return folder; } @@ -504,8 +511,10 @@ register_folder_registered(struct _mail_msg *mm) if (local_folder->folder) { gchar *name; - g_hash_table_insert (local_folder->local_store->folders, local_folder->uri + 8, + g_hash_table_insert (local_folder->local_store->folders, + local_folder->uri + 8, local_folder); + /* Remove the circular ref once the local store knows aboutthe folder */ camel_object_unref ((CamelObject *)local_folder->local_store); @@ -555,7 +564,7 @@ local_storage_new_folder_cb (EvolutionStorageListener *storage_listener, MailLocalFolder *local_folder; struct _register_msg *m; int id; - + if (strcmp (folder->type, "mail") != 0 || strncmp (folder->physical_uri, "file://", 7) != 0 || strncmp (folder->physical_uri + 7, local_store->local_path, -- cgit v1.2.3