aboutsummaryrefslogtreecommitdiffstats
path: root/importers/pine-importer.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-05-10 04:00:35 +0800
committerChris Lahey <clahey@src.gnome.org>2001-05-10 04:00:35 +0800
commit3d170b71061db4d817838854bebaa49387bc4fa9 (patch)
tree958911e7376284c23ea335c468f68f8068efec1f /importers/pine-importer.c
parent33b9baa06344722188b76e54e9396b9a322b9ddf (diff)
downloadgsoc2013-evolution-3d170b71061db4d817838854bebaa49387bc4fa9.tar
gsoc2013-evolution-3d170b71061db4d817838854bebaa49387bc4fa9.tar.gz
gsoc2013-evolution-3d170b71061db4d817838854bebaa49387bc4fa9.tar.bz2
gsoc2013-evolution-3d170b71061db4d817838854bebaa49387bc4fa9.tar.lz
gsoc2013-evolution-3d170b71061db4d817838854bebaa49387bc4fa9.tar.xz
gsoc2013-evolution-3d170b71061db4d817838854bebaa49387bc4fa9.tar.zst
gsoc2013-evolution-3d170b71061db4d817838854bebaa49387bc4fa9.zip
Include bonobo-context.h.
2001-05-09 Christopher James Lahey <clahey@ximian.com> * 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
Diffstat (limited to 'importers/pine-importer.c')
-rw-r--r--importers/pine-importer.c32
1 files changed, 18 insertions, 14 deletions
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 <bonobo/bonobo-object.h>
#include <bonobo/bonobo-generic-factory.h>
#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-context.h>
#include <bonobo/bonobo-main.h>
#include <importer/evolution-intelligent-importer.h>
@@ -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));
}
}