diff options
author | Not Zed <NotZed@Ximian.com> | 2004-02-11 16:26:58 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-02-11 16:26:58 +0800 |
commit | 06b08adb257351bf8080d960fb98b4265cc43081 (patch) | |
tree | 9f429f497d47c5b933d2c4c98a1058566233a7dc /mail/importers/evolution-mbox-importer.c | |
parent | 136b8ea938580f3c1d4fb9f92093c4631ec6038b (diff) | |
download | gsoc2013-evolution-06b08adb257351bf8080d960fb98b4265cc43081.tar.gz gsoc2013-evolution-06b08adb257351bf8080d960fb98b4265cc43081.tar.zst gsoc2013-evolution-06b08adb257351bf8080d960fb98b4265cc43081.zip |
Basically rewrote this, the import tasks run in another thread. It tells
2004-02-11 Not Zed <NotZed@Ximian.com>
* importers/pine-importer.c: Basically rewrote this, the import
tasks run in another thread. It tells you more about what's going
on, and its cancellable.
(pine_store_settings): changed the meaning of the settings
slightly, if set it means we've processed them already.
* mail-component-factory.c (factory): hook in importer factory
callback.
2004-02-10 Not Zed <NotZed@Ximian.com>
* importers/*-importer.c: removed module init, just provide a new
method. Updates for api changes.
* Makefile.am: link mail importers in directly.
* mail-importer.c: changed to do stuff in-memory with linked
stuff, moved to importers/.
* importers/GNOME_Evolution_Mail_Importers.server.in.in: merge all
importer .server info's here, point them all to the mailer
factory. Removed the others.
* importers/Makefile.am: remove Mailer.idl stuff. Move all
importers to a single library.
svn path=/trunk/; revision=24701
Diffstat (limited to 'mail/importers/evolution-mbox-importer.c')
-rw-r--r-- | mail/importers/evolution-mbox-importer.c | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index 83323703af..a7691b38f0 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -39,13 +39,13 @@ #include <importer/evolution-importer.h> #include <importer/GNOME_Evolution_Importer.h> -#include "mozilla-status-headers.h" - -#include "mail/mail-importer.h" -#include "mail-tools.h" +#include "mail/mail-tools.h" +#include "mail/mail-component.h" #include "e-util/e-path.h" +#include "mail-importer.h" + /* #define IMPORTER_DEBUG */ #ifdef IMPORTER_DEBUG #define IN g_print ("=====> %s (%d)\n", G_GNUC_FUNCTION, __LINE__) @@ -55,24 +55,18 @@ #define OUT #endif -#define MBOX_FACTORY_IID "OAFIID:GNOME_Evolution_Mail_Mbox_ImporterFactory:" BASE_VERSION - typedef struct { MailImporter importer; /* Parent */ char *filename; int num; - GNOME_Evolution_Storage_Result create_result; CamelMimeParser *mp; gboolean is_folder; } MboxImporter; -void mail_importer_module_init (void); - /* EvolutionImporter methods */ - static CamelMessageInfo * get_info_from_mozilla (const char *mozilla_status, gboolean *deleted) @@ -240,14 +234,13 @@ importer_destroy_cb (void *data, GObject *object) static gboolean load_file_fn (EvolutionImporter *eimporter, const char *filename, - const char *uri, - const char *folder_type, void *closure) { MboxImporter *mbi; MailImporter *importer; struct stat buf; int fd; + char *uri; mbi = (MboxImporter *) closure; importer = (MailImporter *) mbi; @@ -274,8 +267,10 @@ load_file_fn (EvolutionImporter *eimporter, } importer->mstream = NULL; +#warning "No destination uri" + uri = NULL; if (uri == NULL || *uri == '\0') - importer->folder = mail_tool_get_local_inbox (NULL); + importer->folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_INBOX); else importer->folder = mail_tool_uri_to_folder(uri, 0, NULL); @@ -298,38 +293,15 @@ load_file_fn (EvolutionImporter *eimporter, return FALSE; } -static BonoboObject * -mbox_factory_fn (BonoboGenericFactory *_factory, - const char *cid, - void *closure) +BonoboObject * +mbox_importer_new(void) { EvolutionImporter *importer; MboxImporter *mbox; mbox = g_new0 (MboxImporter, 1); - importer = evolution_importer_new (support_format_fn, load_file_fn, - process_item_fn, NULL, mbox); + importer = evolution_importer_new(NULL, support_format_fn, load_file_fn, process_item_fn, NULL, mbox); g_object_weak_ref(G_OBJECT(importer), importer_destroy_cb, mbox); return BONOBO_OBJECT (importer); } - -/* Entry point */ -void -mail_importer_module_init (void) -{ - static gboolean initialised = FALSE; - BonoboGenericFactory *factory; - - if (initialised == TRUE) - return; - - factory = bonobo_generic_factory_new (MBOX_FACTORY_IID, - mbox_factory_fn, NULL); - - if (factory == NULL) - g_warning ("Could not initialise mbox importer factory."); - - initialised = TRUE; -} - |