diff options
author | Iain Holmes <iain@src.gnome.org> | 2001-02-23 15:13:17 +0800 |
---|---|---|
committer | Iain Holmes <iain@src.gnome.org> | 2001-02-23 15:13:17 +0800 |
commit | 7658347dd9701fc24024792761edbe58c7c350e0 (patch) | |
tree | cd802bf4d118aee92e1850a7de8d748b9e7da07b | |
parent | c2d5b54e94d4a02a4032b5705d23234a236afd53 (diff) | |
download | gsoc2013-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
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/component-factory.c | 4 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 2 | ||||
-rw-r--r-- | mail/mail-importer.c | 39 | ||||
-rw-r--r-- | mail/mail-importer.h | 7 |
5 files changed, 55 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index f455682f36..8257b94375 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2001-02-23 Iain Holmes <iain@ximian.com> + + * component-factory.c (owner_set_cb): Init the importer here. + + * mail-importer.[ch] (mail_importer_create_folder): Add a function that creates + new folders in the shell. + (mail_importer_init): Take in an EvolutionShellClient, and get the local_storage + corba_object from it. + 2001-02-22 Jeffrey Stedfast <fejj@ximian.com> * mail-vtrash.c (create_trash_vfolder): Come up with a unique diff --git a/mail/component-factory.c b/mail/component-factory.c index 34a0e64d4a..2c408db446 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -208,7 +208,8 @@ owner_set_cb (EvolutionShellComponent *shell_component, #endif mail_local_storage_startup (shell_client, evolution_dir); - + mail_importer_init (shell_client); + for (i = 0; i < sizeof (standard_folders) / sizeof (standard_folders[0]); i++) { char *uri = g_strdup_printf ("file://%s/local/%s", evolution_dir, standard_folders[i].name); mail_msg_wait (mail_get_folder (uri, got_folder, standard_folders[i].folder)); @@ -295,7 +296,6 @@ component_factory_init (void) component_fn, NULL); summary_factory = bonobo_generic_factory_new (SUMMARY_FACTORY_ID, summary_fn, NULL); - mail_importer_init (); if (component_factory == NULL || summary_factory == NULL) { e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index d25f2ffaef..4afabc13c0 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -401,7 +401,7 @@ void compose_msg (GtkWidget *widget, gpointer user_data) { GtkWidget *composer; - + if (!check_send_configuration (FOLDER_BROWSER (user_data))) return; 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); } diff --git a/mail/mail-importer.h b/mail/mail-importer.h index cc9c189eef..e50288c6c0 100644 --- a/mail/mail-importer.h +++ b/mail/mail-importer.h @@ -27,6 +27,7 @@ #include <camel/camel-folder.h> #include <camel/camel-stream-mem.h> #include <camel/camel-exception.h> +#include <evolution-shell-client.h> typedef struct _MailImporter MailImporter; struct _MailImporter { @@ -36,8 +37,12 @@ struct _MailImporter { gboolean frozen; /* Is folder frozen? */ }; -void mail_importer_init (void); +void mail_importer_init (EvolutionShellClient *client); void mail_importer_add_line (MailImporter *importer, const char *str, gboolean finished); +void mail_importer_create_folder (const char *parent_path, + const char *name, + const char *type, + const char *description); #endif |