From 3d170b71061db4d817838854bebaa49387bc4fa9 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 9 May 2001 20:00:35 +0000 Subject: Include bonobo-context.h. 2001-05-09 Christopher James Lahey * elm-importer.c, netscape-importer.c, pine-importer.c: Include bonobo-context.h. * netscape-importer.c (netscape_import_accounts): Made a bunch of const char *s here. (importer_cb): Replaced CORBA_OBJECT_NIL with CORBA_NO_EXCEPTION in a error check here. (netscape_create_structure): Removed unused data variable here. Added BONOBO_OBJECT casts. (importer_init): Changed factory to be a BonoboGenericFactory * instead of a BonoboObject *. * pine-importer.c (import_addressfile): Changed signature to match EBookCallback signature. Added char *email variable. Removed EList since we only need to deal with one email for now. Changed this to not set the file as to the fullname. (pine_can_import): Removed unused settings and addressbook variables. (pine_create_structure): Added BONOBO_OBJECT casts. svn path=/trunk/; revision=9731 --- importers/pine-importer.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'importers/pine-importer.c') diff --git a/importers/pine-importer.c b/importers/pine-importer.c index 3b3d2c0d57..d0d9f33c45 100644 --- a/importers/pine-importer.c +++ b/importers/pine-importer.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -218,12 +219,14 @@ parse_address (const char *address) static void import_addressfile (EBook *book, EBookStatus status, - PineImporter *importer) + gpointer user_data) { char *addressbook; FILE *handle; char line[4096]; + PineImporter *importer = user_data; + addressbook = gnome_util_prepend_user_home (".addressbook"); handle = fopen (addressbook, "r"); g_free (addressbook); @@ -234,9 +237,8 @@ import_addressfile (EBook *book, } while (fgets (line, 4096, handle) != NULL) { - char *nick, *fullname, *address, *comment, *fcc; + char *nick, *fullname, *address, *comment, *fcc, *email = NULL; char *start; - EList *emaillist = e_list_new (NULL, g_free, NULL); gboolean distrib = FALSE; start = line; @@ -285,10 +287,9 @@ import_addressfile (EBook *book, } } } else { - char *real = parse_address (address); + email = parse_address (address); - g_print ("Real address: %s", real); - e_list_append (emaillist, real); + g_print ("Real address: %s", email); } fcc = get_field (&start, handle); @@ -304,12 +305,15 @@ import_addressfile (EBook *book, ECard *card = e_card_new (""); ECardSimple *simple = e_card_simple_new (card); - e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_FILE_AS, - fullname ? fullname : nick); - e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_FULL_NAME, - fullname); + if (fullname != NULL) + e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_FULL_NAME, + fullname); + else + e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_FILE_AS, + nick); + e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_EMAIL, - emaillist); + email); e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_NOTE, comment); e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_NICKNAME, @@ -418,7 +422,7 @@ pine_can_import (EvolutionIntelligentImporter *ii, { PineImporter *importer = closure; char *key, *maildir, *evolution_dir, *addrfile; - gboolean mail, settings, addressbook; + gboolean mail; gboolean md_exists, addr_exists; /* Already imported */ @@ -570,7 +574,7 @@ pine_create_structure (EvolutionIntelligentImporter *ii, PineImporter *importer = closure; char *maildir, *key, *evolution_dir; - bonobo_object_ref (ii); + bonobo_object_ref (BONOBO_OBJECT (ii)); pine_store_settings (importer); evolution_dir = gnome_util_prepend_user_home ("evolution"); @@ -608,7 +612,7 @@ pine_create_structure (EvolutionIntelligentImporter *ii, once the mail is imported */ /* Hmmm, this needs fixed badly */ - bonobo_object_unref (ii); + bonobo_object_unref (BONOBO_OBJECT (ii)); } } -- cgit v1.2.3