aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-importer.c
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-02-23 15:13:17 +0800
committerIain Holmes <iain@src.gnome.org>2001-02-23 15:13:17 +0800
commit7658347dd9701fc24024792761edbe58c7c350e0 (patch)
treecd802bf4d118aee92e1850a7de8d748b9e7da07b /mail/mail-importer.c
parentc2d5b54e94d4a02a4032b5705d23234a236afd53 (diff)
downloadgsoc2013-evolution-7658347dd9701fc24024792761edbe58c7c350e0.tar.gz
gsoc2013-evolution-7658347dd9701fc24024792761edbe58c7c350e0.tar.zst
gsoc2013-evolution-7658347dd9701fc24024792761edbe58c7c350e0.zip
New stuff for the importer to create a new folder
svn path=/trunk/; revision=8365
Diffstat (limited to 'mail/mail-importer.c')
-rw-r--r--mail/mail-importer.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/mail/mail-importer.c b/mail/mail-importer.c
index b46c4ccc50..03f2bd374b 100644
--- a/mail/mail-importer.c
+++ b/mail/mail-importer.c
@@ -28,7 +28,9 @@
#include <bonobo.h>
#include "mail-importer.h"
#include "mail-local.h"
+#include "mail.h"
+#include <evolution-storage.h>
#include <camel/camel-folder.h>
#include <camel/camel-mime-message.h>
#include <camel/camel-stream-mem.h>
@@ -40,6 +42,37 @@
static gboolean factory_initialised = FALSE;
extern char *evolution_dir;
+
+static GNOME_Evolution_LocalStorage local_storage = NULL;
+
+void
+mail_importer_create_folder (const char *parent_path,
+ const char *name,
+ const char *type,
+ const char *description)
+{
+ BonoboListener *listener;
+ Bonobo_Listener corba_listener;
+ CORBA_Environment ev;
+ char *path, *physical;
+
+ path = g_concat_dir_and_file (parent_path, name);
+ physical = g_strdup_printf ("file://%s/local/%s", evolution_dir,
+ parent_path);
+
+ listener = bonobo_listener_new (NULL, NULL);
+ corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (listener));
+
+ CORBA_exception_init (&ev);
+ GNOME_Evolution_Storage_asyncCreateFolder (local_storage,
+ path, "mail", name,
+ physical,
+ corba_listener, &ev);
+ CORBA_exception_free (&ev);
+ g_free (path);
+ g_free (physical);
+}
+
/**
* mail_importer_add_line:
* importer: A MailImporter structure.
@@ -93,9 +126,10 @@ mail_importer_add_line (MailImporter *importer,
* Initialises all the importers
*/
void
-mail_importer_init (void)
+mail_importer_init (EvolutionShellClient *client)
{
BonoboGenericFactory *factory;
+
if (factory_initialised == TRUE)
return;
@@ -112,7 +146,8 @@ mail_importer_init (void)
if (factory == NULL) {
g_error ("Unable to create mbox factory.");
}
-
+
factory_initialised = TRUE;
+ local_storage = evolution_shell_client_get_local_storage (client);
}