diff options
author | Dan Winship <danw@src.gnome.org> | 2000-06-29 07:12:50 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-06-29 07:12:50 +0800 |
commit | 7fe829bb5225f3dbabd3db34ebf0068f4a43638d (patch) | |
tree | bf614881c59b183067010da67f65fc505d83ee3a /mail/component-factory.c | |
parent | 66c6a7abb460223a18c536bbf520702aaf4f3155 (diff) | |
download | gsoc2013-evolution-7fe829bb5225f3dbabd3db34ebf0068f4a43638d.tar gsoc2013-evolution-7fe829bb5225f3dbabd3db34ebf0068f4a43638d.tar.gz gsoc2013-evolution-7fe829bb5225f3dbabd3db34ebf0068f4a43638d.tar.bz2 gsoc2013-evolution-7fe829bb5225f3dbabd3db34ebf0068f4a43638d.tar.lz gsoc2013-evolution-7fe829bb5225f3dbabd3db34ebf0068f4a43638d.tar.xz gsoc2013-evolution-7fe829bb5225f3dbabd3db34ebf0068f4a43638d.tar.zst gsoc2013-evolution-7fe829bb5225f3dbabd3db34ebf0068f4a43638d.zip |
Refuse to create folders not of type "mail", and correctly create an empty
* component-factory.c (create_folder): Refuse to create folders
not of type "mail", and correctly create an empty "mbox" folder
for new folders in /local.
svn path=/trunk/; revision=3781
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r-- | mail/component-factory.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c index a48ada7327..c6d6f47e19 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -109,13 +109,35 @@ create_folder (EvolutionShellComponent *shell_component, void *closure) { CORBA_Environment ev; + CamelStore *store; + CamelFolder *folder; + CamelException ex; + Evolution_ShellComponentListener_Result result; + + camel_exception_init (&ex); + if (strcmp (type, "mail") != 0) + result = Evolution_ShellComponentListener_UNSUPPORTED_TYPE; + else { + char *camel_url = g_strdup_printf ("mbox://%s", physical_uri); + + store = camel_session_get_store (session, camel_url, &ex); + g_free (camel_url); + if (!camel_exception_is_set (&ex)) { + folder = camel_store_get_folder (store, "mbox", + TRUE, &ex); + gtk_object_unref (GTK_OBJECT (store)); + } + if (!camel_exception_is_set (&ex)) { + gtk_object_unref (GTK_OBJECT (folder)); + result = Evolution_ShellComponentListener_OK; + } else + result = Evolution_ShellComponentListener_INVALID_URI; + } - /* FIXME: Implement. */ + camel_exception_clear (&ex); CORBA_exception_init (&ev); - - Evolution_ShellComponentListener_report_result (listener, Evolution_ShellComponentListener_OK, &ev); - + Evolution_ShellComponentListener_report_result (listener, result, &ev); CORBA_exception_free (&ev); } |