From 04ee7c6788eaeec1b8e7a5b5048b7e9e28b8fa0c Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Tue, 20 Mar 2001 20:11:13 +0000 Subject: Step the parser so it imports more than one message. svn path=/trunk/; revision=8854 --- mail/ChangeLog | 5 +++++ mail/importers/evolution-mbox-importer.c | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index d06e00beb6..30a866dcf3 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2001-03-20 Iain Holmes + + * importers/evolution-mbox-importer.c (process_item_fn): Step the parser + so that it will import more than one message. + 2001-03-20 JP Rosevear * importers/Makefile.am: extra dist the oaf files diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index 241055cb10..b39691f0dc 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -38,6 +38,17 @@ #include #include #include +#include +#include "mail-tools.h" + +#define IMPORTER_DEBUG +#ifdef IMPORTER_DEBUG +#define IN g_print ("=====> %s (%d)\n", __FUNCTION__, __LINE__) +#define OUT g_print ("<==== %s (%d)\n", __FUNCTION__, __LINE__) +#else +#define IN +#define OUT +#endif #define MBOX_FACTORY_IID "OAFIID:GNOME_Evolution_Mail_Mbox_ImporterFactory" @@ -49,6 +60,7 @@ typedef struct { CamelMimeParser *mp; } MboxImporter; +void mail_importer_module_init (void); /* EvolutionImporter methods */ @@ -69,6 +81,7 @@ process_item_fn (EvolutionImporter *eimporter, CamelMimeMessage *msg; CamelMessageInfo *info; + IN; msg = camel_mime_message_new (); if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (msg), mbi->mp) == -1) { @@ -86,12 +99,19 @@ process_item_fn (EvolutionImporter *eimporter, g_warning ("Failed message %d", mbi->num); done = TRUE; } + OUT; } else { + IN; /* all messages have now been imported */ camel_folder_sync (importer->folder, FALSE, ex); camel_folder_thaw (importer->folder); importer->frozen = FALSE; done = TRUE; + OUT; + } + + if (!done) { + camel_mime_parser_step (mbi->mp, 0, 0); } camel_exception_free (ex); -- cgit