aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-06-29 07:12:50 +0800
committerDan Winship <danw@src.gnome.org>2000-06-29 07:12:50 +0800
commit7fe829bb5225f3dbabd3db34ebf0068f4a43638d (patch)
treebf614881c59b183067010da67f65fc505d83ee3a
parent66c6a7abb460223a18c536bbf520702aaf4f3155 (diff)
downloadgsoc2013-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
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/component-factory.c30
2 files changed, 31 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 3e7c9a1f69..161c15ca21 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,8 +1,12 @@
2000-06-28 Dan Winship <danw@helixcode.com>
+ * 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.
+
* main.c (init_corba): Call od_assert_using_oaf() or
od_assert_using_goad() as appropriate to make sure people didn't
- someone trick the build system.
+ somehow trick the build system.
2000-06-28 Jeffrey Stedfast <fejj@helixcode.com>
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);
}