diff options
author | Not Zed <NotZed@Ximian.com> | 2004-01-16 15:14:15 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-01-16 15:14:15 +0800 |
commit | 7ab4ccfe7670d38a00fa2a9c06dcc7a60a4c2726 (patch) | |
tree | 54f571c328e4070bdcd96799d048a88596e6b9c8 /mail/mail-folder-cache.c | |
parent | 21d0e891e218511c00b8f71769eaee998f61edfd (diff) | |
download | gsoc2013-evolution-7ab4ccfe7670d38a00fa2a9c06dcc7a60a4c2726.tar.gz gsoc2013-evolution-7ab4ccfe7670d38a00fa2a9c06dcc7a60a4c2726.tar.zst gsoc2013-evolution-7ab4ccfe7670d38a00fa2a9c06dcc7a60a4c2726.zip |
change this to check the store using the provider url_cmp and just lookup
2004-01-16 Not Zed <NotZed@Ximian.com>
* mail-folder-cache.c (storeinfo_find_folder_info): change this to
check the store using the provider url_cmp and just lookup the
folder name directly. folder_compare can't be used for uri's,
this stuff was so broken, my fault :(
** See bug #52467.
* em-folder-tree-model.c (sort_cb): handle null path (root?).
* mail-vfolder.c (mail_vfolder_add_uri): map uri to euri before
processing.
(rule_changed): map uri to camel uri before looking up.
(mail_vfolder_delete_uri): handle as euri internally.
(mail_vfolder_rename_uri): "
* mail-autofilter.c (vfolder_rule_from_message): map camel uri to
euri before setting as vfolder source.
svn path=/trunk/; revision=24266
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r-- | mail/mail-folder-cache.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 750f9ab30d..285f1d1230 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -932,24 +932,34 @@ mail_note_store(CamelStore *store, CamelOperation *op, struct _find_info { const char *uri; struct _folder_info *fi; + CamelURL *url; }; /* look up on each storeinfo using proper hash function for that stores uri's */ static void storeinfo_find_folder_info(CamelStore *store, struct _store_info *si, struct _find_info *fi) { - if (fi->fi == NULL) - fi->fi = g_hash_table_lookup(si->folders_uri, fi->uri); + if (fi->fi == NULL) { + if (((CamelService *)store)->provider->url_equal(fi->url, ((CamelService *)store)->url)) { + char *path = fi->url->fragment?fi->url->fragment:fi->url->path; + + if (path[0] == '/') + path++; + fi->fi = g_hash_table_lookup(si->folders, path); + } + } } /* returns TRUE if the uri is available, folderp is set to a reffed folder if the folder has also already been opened */ int mail_note_get_folder_from_uri(const char *uri, CamelFolder **folderp) { - struct _find_info fi = { uri, NULL }; + struct _find_info fi = { uri, NULL, NULL }; if (stores == NULL) return FALSE; + fi.url = camel_url_new(uri, NULL); + LOCK(info_lock); g_hash_table_foreach(stores, (GHFunc)storeinfo_find_folder_info, &fi); if (folderp) { @@ -962,5 +972,7 @@ int mail_note_get_folder_from_uri(const char *uri, CamelFolder **folderp) } UNLOCK(info_lock); + camel_url_free(fi.url); + return fi.fi != NULL; } |