diff options
author | Not Zed <NotZed@Ximian.com> | 2004-01-19 14:03:35 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-01-19 14:03:35 +0800 |
commit | bfe94239cae433e03a38dcc021a34e180f33cbb0 (patch) | |
tree | 1d519567ea2871dfd4508b6cdec85ac51b5988e0 /camel/camel-vee-store.c | |
parent | 4a011b9d49d23d3f26a9d054b5c9a5412a61b254 (diff) | |
download | gsoc2013-evolution-bfe94239cae433e03a38dcc021a34e180f33cbb0.tar.gz gsoc2013-evolution-bfe94239cae433e03a38dcc021a34e180f33cbb0.tar.zst gsoc2013-evolution-bfe94239cae433e03a38dcc021a34e180f33cbb0.zip |
use a CamelURL to properly encode the url we generate.
2004-01-19 Not Zed <NotZed@Ximian.com>
* camel-vee-store.c (change_folder): use a CamelURL to properly
encode the url we generate.
(vee_get_folder_info): ditto.
(vee_get_folder_info): removed unused variable/warning.
* camel-session.c (vee_provider): Update the provider flags for
URL_FRAGMENT_IS_PATH.
* providers/imapp/camel-imapp-utils.c (imap_parse_addfress_list):
namespaces fixes for HEADER_ADDRESS*
svn path=/trunk/; revision=24299
Diffstat (limited to 'camel/camel-vee-store.c')
-rw-r--r-- | camel/camel-vee-store.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c index 8e5273ec64..20f39106b9 100644 --- a/camel/camel-vee-store.c +++ b/camel/camel-vee-store.c @@ -128,6 +128,7 @@ change_folder(CamelStore *store, const char *name, guint32 flags, int count) { CamelFolderInfo *fi; const char *tmp; + CamelURL *url; fi = g_malloc0(sizeof(*fi)); fi->full_name = g_strdup(name); @@ -137,7 +138,14 @@ change_folder(CamelStore *store, const char *name, guint32 flags, int count) else tmp++; fi->name = g_strdup(tmp); - fi->url = g_strdup_printf("vfolder:%s%s#%s", ((CamelService *)store)->url->path, (flags&CHANGE_NOSELECT)?";noselect=yes":"", name); + url = camel_url_new("vfolder:", 0); + camel_url_set_path(url, ((CamelService *)store)->url->path); + if (flags & CHANGE_NOSELECT) + camel_url_set_param(url, "noselect", "yes"); + camel_url_set_fragment(url, name); + fi->url = camel_url_to_string(url, 0); + camel_url_free(url); + /*fi->url = g_strdup_printf("vfolder:%s%s#%s", ((CamelService *)store)->url->path, (flags&CHANGE_NOSELECT)?";noselect=yes":"", name);*/ fi->unread_message_count = count; camel_folder_info_build_path(fi, '/'); camel_object_trigger_event(store, (flags&CHANGE_DELETE)?"folder_deleted":"folder_created", fi); @@ -215,8 +223,9 @@ static CamelFolderInfo * vee_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex) { CamelFolderInfo *info, *res = NULL, *tail; - GPtrArray *folders, *infos; + GPtrArray *folders; GHashTable *infos_hash; + CamelURL *url; int i; d(printf("Get folder info '%s'\n", top?top:"<null>")); @@ -257,8 +266,14 @@ vee_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExce camel_folder_refresh_info((CamelFolder *)folder, NULL); info = g_malloc0(sizeof(*info)); + url = camel_url_new("vfolder:", NULL); + camel_url_set_path(url, ((CamelService *)((CamelFolder *)folder)->parent_store)->url->path); + camel_url_set_fragment(url, ((CamelFolder *)folder)->full_name); + info->url = camel_url_to_string(url, 0); + camel_url_free(url); +/* info->url = g_strdup_printf("vfolder:%s#%s", ((CamelService *)((CamelFolder *)folder)->parent_store)->url->path, - ((CamelFolder *)folder)->full_name); + ((CamelFolder *)folder)->full_name);*/ info->full_name = g_strdup(((CamelFolder *)folder)->full_name); info->name = g_strdup(((CamelFolder *)folder)->name); info->unread_message_count = camel_folder_get_unread_message_count((CamelFolder *)folder); @@ -310,7 +325,12 @@ vee_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExce /* and always add UNMATCHED, if scanning from top/etc */ if (top == NULL || top[0] == 0 || strncmp(top, CAMEL_UNMATCHED_NAME, strlen(CAMEL_UNMATCHED_NAME)) == 0) { info = g_malloc0(sizeof(*info)); - info->url = g_strdup_printf("vfolder:%s#%s", ((CamelService *)store)->url->path, CAMEL_UNMATCHED_NAME); + url = camel_url_new("vfolder:", NULL); + camel_url_set_path(url, ((CamelService *)store)->url->path); + camel_url_set_fragment(url, CAMEL_UNMATCHED_NAME); + info->url = camel_url_to_string(url, 0); + camel_url_free(url); + /*info->url = g_strdup_printf("vfolder:%s#%s", ((CamelService *)store)->url->path, CAMEL_UNMATCHED_NAME);*/ info->full_name = g_strdup(CAMEL_UNMATCHED_NAME); info->name = g_strdup(CAMEL_UNMATCHED_NAME); info->unread_message_count = -1; |