diff options
author | Not Zed <NotZed@Ximian.com> | 2003-02-05 12:25:40 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-02-05 12:25:40 +0800 |
commit | 2dd6f4d7deacc0410411b47d77c1ba60cc927af0 (patch) | |
tree | e55e7089f8209575c7eb38921a12dc2fd4169b0a /mail/importers/evolution-mbox-importer.c | |
parent | 5c82a6632996c2062de16486eb6c91476dc63946 (diff) | |
download | gsoc2013-evolution-2dd6f4d7deacc0410411b47d77c1ba60cc927af0.tar gsoc2013-evolution-2dd6f4d7deacc0410411b47d77c1ba60cc927af0.tar.gz gsoc2013-evolution-2dd6f4d7deacc0410411b47d77c1ba60cc927af0.tar.bz2 gsoc2013-evolution-2dd6f4d7deacc0410411b47d77c1ba60cc927af0.tar.lz gsoc2013-evolution-2dd6f4d7deacc0410411b47d77c1ba60cc927af0.tar.xz gsoc2013-evolution-2dd6f4d7deacc0410411b47d77c1ba60cc927af0.tar.zst gsoc2013-evolution-2dd6f4d7deacc0410411b47d77c1ba60cc927af0.zip |
update from ../../importers/. (main): Removed.
2003-02-05 Not Zed <NotZed@Ximian.com>
* importers/netscape-importer.c: update from ../../importers/.
(main): Removed.
(mail_importer_module_init): Setup module init fn.
(factory_fn): api changes.
(is_dir_empty): deprecated changes, and clean up logic.
(importer_cb): pulse progress bar, use idle function for
processing next item.
(import_next): Remove link before recursing, also fix memleak, and
api changes.
(netscape_import_file): dont release importer.
(*): gconf'ify
* importers/elm-importer.c (elm_factory_fn): Track the
evolution_intelligent_importer, so we can unref it when done.
(*): gconf'ify.
* importers/pine-importer.c (parse_line): use gobject stuff rather
than gtkobject.
(import_addressfile): close down 'properly' when finished.
(importer_timeout_fn): Do most processing decisions here, either
from a timeout or idle function. This prevents us getting 1 stack
frame per message and per folder. Close down properly also.
(importer_cb): Add a timeout, ignore the callback, or add an idle
function to process the next item.
(pine_import_file): dont release the importer if we can't load it,
its released elsewhere, i think.
(import_addressfile): step the progress bar as we go.
(factory_fn): Track the evolution_intelligent_importer, so we can
unref when done.
(*): gconf'ify
2003-01-31 Not Zed <NotZed@Ximian.com>
* importers/elm-importer.c (elm_can_import): g_file_exists ->
lstat, and g_build_filename api changes.
* importers/pine-importer.c: moved from
../../importers/pine-importer.c
(factory_fn): oaf->bonobo_activation
(mail_importer_module_init): setup factory.
(main): Removed.
(*): REemove bonobo config stuff.
(factory_fn): destroy signal -> weak ref.
(pine_destroy_cb): Fix signature for weak ref notify.
(import_addressfile): use new glib filename stuff.
(import_addressbook): same.
(pine_can_import): and here.
(import_next): and here.
(scan_dir): and here
(pine_create_structure): And here.
(pine_can_import): g_file_exists -> lstat.
(importer_cb): If there are more items, use an idle handler to
drop back a few stack frames rather than recursing for each
message.
(import_next): unlink data from dir_list before recursing, and fix
leak.
2003-01-30 Not Zed <NotZed@Ximian.com>
* importers/elm-importer.c (elm_destroy_cb): Change for weak ref
setup.
(elm_factory_fn): destroy -> weak ref.
2003-01-29 Not Zed <NotZed@Ximian.com>
* importers/elm-importer.c (importer_cb): Pass processItem off to
an idle handler, so we dont blow our stacks. Also update to use
progress_bar_pulse().
(import_item_idle): Get the next message here instead.
(import_next): Fix a glist leak. Unlink the file before we import
it too. And close the dialogue and clean up when we've run out of
folders to import.
2003-01-17 Not Zed <NotZed@Ximian.com>
* importers/elm-importer.c (elm_create_structure): use/free elmdir
rather than double-free maildir.
2003-01-16 Not Zed <NotZed@Ximian.com>
* importers/elm-importer.c: update from ../importers/elm-importer.c
svn path=/trunk/; revision=19752
Diffstat (limited to 'mail/importers/evolution-mbox-importer.c')
-rw-r--r-- | mail/importers/evolution-mbox-importer.c | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index 181f817898..4c948a595c 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -62,6 +62,8 @@ typedef struct { char *filename; int num; + GNOME_Evolution_Storage_Result create_result; + CamelMimeParser *mp; gboolean is_folder; } MboxImporter; @@ -118,9 +120,18 @@ process_item_fn (EvolutionImporter *eimporter, const char *mozilla_status; if (importer->folder == NULL) { - GNOME_Evolution_ImporterListener_notifyResult (listener, - GNOME_Evolution_ImporterListener_NOT_READY, - TRUE, ev); + /* if it failed, need to say it failed ... */ + /* the create_folder callback needs to store the create result */ + /* here we need to pass FALSE for more items */ + printf("not ready\n"); + if (mbi->create_result == GNOME_Evolution_Storage_OK) + GNOME_Evolution_ImporterListener_notifyResult (listener, + GNOME_Evolution_ImporterListener_NOT_READY, + TRUE, ev); + else + GNOME_Evolution_ImporterListener_notifyResult (listener, + GNOME_Evolution_ImporterListener_BAD_FILE, + FALSE, ev); return; } @@ -147,7 +158,6 @@ process_item_fn (EvolutionImporter *eimporter, } else { mozilla_status = camel_medium_get_header (CAMEL_MEDIUM (msg), "X-Mozilla-Status"); if (mozilla_status != NULL) { - g_print ("Got Mozilla status header: %s\n", mozilla_status); info = get_info_from_mozilla (mozilla_status, &deleted); } else { deleted = FALSE; @@ -183,6 +193,7 @@ process_item_fn (EvolutionImporter *eimporter, camel_mime_parser_step (mbi->mp, 0, 0); camel_exception_free (ex); + GNOME_Evolution_ImporterListener_notifyResult (listener, GNOME_Evolution_ImporterListener_OK, !done, ev); @@ -220,13 +231,14 @@ importer_destroy_cb (void *data, GObject *object) MboxImporter *mbi = data; MailImporter *importer = data; - if (importer->frozen) { - camel_folder_sync (importer->folder, FALSE, NULL); - camel_folder_thaw (importer->folder); - } + if (importer->folder) { + if (importer->frozen) { + camel_folder_sync (importer->folder, FALSE, NULL); + camel_folder_thaw (importer->folder); + } - if (importer->folder) camel_object_unref (importer->folder); + } g_free (mbi->filename); if (mbi->mp) @@ -251,6 +263,13 @@ folder_created_cb (BonoboListener *listener, } result = event_data->_value; + + printf("folder created cb, result = %d\n", result->result); + ((MboxImporter *)importer)->create_result = result->result; + + if (result->result != GNOME_Evolution_Storage_OK) + return; + fullpath = g_strconcat ("file://", result->path, NULL); ex = camel_exception_new (); @@ -260,6 +279,8 @@ folder_created_cb (BonoboListener *listener, camel_exception_free (ex); g_free (fullpath); + ((MboxImporter *)importer)->create_result = GNOME_Evolution_Storage_GENERIC_ERROR; + return; } @@ -337,11 +358,9 @@ load_file_fn (EvolutionImporter *eimporter, g_signal_connect((listener), "event-notify", G_CALLBACK (folder_created_cb), importer); - + mbi->create_result = GNOME_Evolution_Storage_OK; mail_importer_create_folder (parent, name, NULL, listener); - importer->folder = NULL; - g_print ("No folder yet\n"); - delayed = TRUE; + delayed = importer->folder == NULL; g_free (parent); } camel_exception_free (ex); |