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 | |
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')
-rw-r--r-- | camel/ChangeLog | 13 | ||||
-rw-r--r-- | camel/camel-session.c | 3 | ||||
-rw-r--r-- | camel/camel-vee-store.c | 28 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-utils.c | 4 |
4 files changed, 40 insertions, 8 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index fc8ccb678b..ea38da7526 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,16 @@ +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* + 2004-01-17 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (imap_sync_online): Limit the diff --git a/camel/camel-session.c b/camel/camel-session.c index fc31530768..ba7de9e14f 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -79,8 +79,7 @@ static CamelProvider vee_provider = { "vfolder", CAMEL_PROVIDER_IS_STORAGE, - - CAMEL_URL_NEED_PATH, /* url_flags */ + CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH, /* ... */ }; 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; diff --git a/camel/providers/imapp/camel-imapp-utils.c b/camel/providers/imapp/camel-imapp-utils.c index e20499689d..19bdb3b036 100644 --- a/camel/providers/imapp/camel-imapp-utils.c +++ b/camel/providers/imapp/camel-imapp-utils.c @@ -526,7 +526,7 @@ imap_parse_address_list(CamelIMAPPStream *is) camel_exception_throw(1, "missing '(' for address"); addr = camel_header_address_new(); - addr->type = HEADER_ADDRESS_NAME; + addr->type = CAMEL_HEADER_ADDRESS_NAME; tok = camel_imapp_stream_nstring(is, &token); addr->name = g_strdup(token); /* we ignore the route, nobody uses it in the real world */ @@ -550,7 +550,7 @@ imap_parse_address_list(CamelIMAPPStream *is) d(printf("adding group '%s'\n", mbox)); g_free(addr->name); addr->name = mbox; - addr->type = HEADER_ADDRESS_GROUP; + addr->type = CAMEL_HEADER_ADDRESS_GROUP; camel_header_address_list_append(&list, addr); group = addr; } |