aboutsummaryrefslogtreecommitdiffstats
path: root/importers
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
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')
-rw-r--r--importers/ChangeLog22
-rw-r--r--importers/elm-importer.c1
-rw-r--r--importers/netscape-importer.c23
-rw-r--r--importers/pine-importer.c32
4 files changed, 54 insertions, 24 deletions
diff --git a/importers/ChangeLog b/importers/ChangeLog
index 17c630363a..ca6e3878de 100644
--- a/importers/ChangeLog
+++ b/importers/ChangeLog
@@ -1,3 +1,25 @@
+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.
+
2001-05-08 Iain Holmes <iain@ximian.com>
* *: Added everything to CVS.
diff --git a/importers/elm-importer.c b/importers/elm-importer.c
index d62264b973..33c0487953 100644
--- a/importers/elm-importer.c
+++ b/importers/elm-importer.c
@@ -38,6 +38,7 @@
#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-context.h>
#include <bonobo/bonobo-generic-factory.h>
#include <bonobo/bonobo-main.h>
diff --git a/importers/netscape-importer.c b/importers/netscape-importer.c
index 41e3a080f6..67d20d835b 100644
--- a/importers/netscape-importer.c
+++ b/importers/netscape-importer.c
@@ -40,6 +40,7 @@
#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-generic-factory.h>
#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-context.h>
#include <importer/evolution-intelligent-importer.h>
#include <importer/GNOME_Evolution_Importer.h>
@@ -292,8 +293,8 @@ netscape_init_prefs (void)
static void
netscape_import_accounts (NetscapeImporter *importer)
{
- char *nstr;
- char *imap;
+ const char *nstr;
+ const char *imap;
GNOME_Evolution_MailConfig_Account account;
GNOME_Evolution_MailConfig_Service source, transport;
GNOME_Evolution_MailConfig_Identity id;
@@ -332,7 +333,8 @@ netscape_import_accounts (NetscapeImporter *importer)
/* Create transport */
nstr = netscape_get_string ("network.hosts.smtp_server");
if (nstr != NULL) {
- char *url, *nstr2;
+ char *url;
+ const char *nstr2;
nstr2 = netscape_get_string ("mail.smtp_name");
if (nstr2) {
@@ -365,7 +367,8 @@ netscape_import_accounts (NetscapeImporter *importer)
/* Create POP3 source */
nstr = netscape_get_string ("network.hosts.pop_server");
if (nstr != NULL && *nstr != 0) {
- char *url, *nstr2;
+ char *url;
+ const char *nstr2;
nstr2 = netscape_get_string ("mail.pop_name");
if (nstr2) {
@@ -390,7 +393,8 @@ netscape_import_accounts (NetscapeImporter *importer)
servers = g_strsplit (imap, ",", 1024);
for (i = 0; servers[i] != NULL; i++) {
GNOME_Evolution_MailConfig_Service imapsource;
- char *serverstr, *name, *url, *username;
+ char *serverstr, *name, *url;
+ const char *username;
g_warning ("i: %d", i);
/* Create a server for each of these */
@@ -520,7 +524,7 @@ importer_cb (EvolutionImporterListener *listener,
objref = bonobo_object_corba_objref (BONOBO_OBJECT (importer->listener));
GNOME_Evolution_Importer_processItem (importer->importer,
objref, &ev);
- if (ev._major != CORBA_OBJECT_NIL) {
+ if (ev._major != CORBA_NO_EXCEPTION) {
g_warning ("Exception: %s", CORBA_exception_id (&ev));
CORBA_exception_free (&ev);
return;
@@ -701,14 +705,13 @@ netscape_create_structure (EvolutionIntelligentImporter *ii,
void *closure)
{
NetscapeImporter *importer = closure;
- NetscapeCreateDirectoryData *data;
char *key, *evolution_dir;
g_return_if_fail (nsmail_dir != NULL);
/* Reference our object so when the shell release_unrefs us
we will still exist and not go byebye */
- bonobo_object_ref (ii);
+ bonobo_object_ref (BONOBO_OBJECT (ii));
netscape_store_settings (importer);
evolution_dir = gnome_util_prepend_user_home ("evolution");
@@ -743,7 +746,7 @@ netscape_create_structure (EvolutionIntelligentImporter *ii,
/* Destroy it here if we weren't importing mail
otherwise the mail importer destroys itself
once the mail in imported */
- bonobo_object_unref (ii);
+ bonobo_object_unref (BONOBO_OBJECT (ii));
}
}
@@ -876,7 +879,7 @@ factory_fn (BonoboGenericFactory *_factory,
static void
importer_init (void)
{
- BonoboObject *factory;
+ BonoboGenericFactory *factory;
g_print ("Hi");
factory = bonobo_generic_factory_new (FACTORY_IID, factory_fn, NULL);
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));
}
}