aboutsummaryrefslogtreecommitdiffstats
path: root/mail/component-factory.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-08-21 05:49:09 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-08-21 05:49:09 +0800
commita1a0a6bc4c8b444afe9ba4ee3feaec28192252ae (patch)
tree4a81395fc00f583a469cf04bd4983a56fa7d507a /mail/component-factory.c
parentecda947f67aa5a7f2068fa73cea779c81df6806d (diff)
downloadgsoc2013-evolution-a1a0a6bc4c8b444afe9ba4ee3feaec28192252ae.tar.gz
gsoc2013-evolution-a1a0a6bc4c8b444afe9ba4ee3feaec28192252ae.tar.zst
gsoc2013-evolution-a1a0a6bc4c8b444afe9ba4ee3feaec28192252ae.zip
Modify the url and set the protocol to mbox rather than hacking it and
2001-08-20 Jeffrey Stedfast <fejj@ximian.com> * component-factory.c (create_folder): Modify the url and set the protocol to mbox rather than hacking it and prepending mbox: to the uri. * mail-local.c (get_folder): Don't prepend the folder_name with the store's path because the hash key is folder_name, not /folder_name. svn path=/trunk/; revision=12325
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r--mail/component-factory.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 21e2a5ed30..d391092901 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -177,18 +177,18 @@ static void
create_folder_done (char *uri, CamelFolder *folder, void *data)
{
GNOME_Evolution_ShellComponentListener listener = data;
- CORBA_Environment ev;
GNOME_Evolution_ShellComponentListener_Result result;
-
+ CORBA_Environment ev;
+
if (folder)
result = GNOME_Evolution_ShellComponentListener_OK;
else
result = GNOME_Evolution_ShellComponentListener_INVALID_URI;
-
- CORBA_exception_init(&ev);
- GNOME_Evolution_ShellComponentListener_notifyResult(listener, result, &ev);
- CORBA_Object_release(listener, &ev);
- CORBA_exception_free(&ev);
+
+ CORBA_exception_init (&ev);
+ GNOME_Evolution_ShellComponentListener_notifyResult (listener, result, &ev);
+ CORBA_Object_release (listener, &ev);
+ CORBA_exception_free (&ev);
}
static void
@@ -198,20 +198,27 @@ create_folder (EvolutionShellComponent *shell_component,
const GNOME_Evolution_ShellComponentListener listener,
void *closure)
{
- char *uri;
CORBA_Environment ev;
+ CamelURL *url;
+ char *uri;
+
+ CORBA_exception_init (&ev);
- CORBA_exception_init(&ev);
- if (!strcmp (type, "mail")) {
- /* This makes the uri start with mbox://file://, which
- looks silly but turns into a CamelURL that has
- url->provider of "mbox" */
- uri = g_strdup_printf ("mbox://%s", physical_uri);
+ url = physical_uri ? camel_url_new (physical_uri, NULL) : NULL;
+
+ if (url && !strcmp (type, "mail")) {
+ camel_url_set_protocol (url, "mbox");
+ uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
mail_create_folder (uri, create_folder_done, CORBA_Object_duplicate (listener, &ev));
+ g_free (uri);
} else {
GNOME_Evolution_ShellComponentListener_notifyResult (
listener, GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE, &ev);
}
+
+ if (url)
+ camel_url_free (url);
+
CORBA_exception_free (&ev);
}