aboutsummaryrefslogtreecommitdiffstats
path: root/mail/importers
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-11-18 19:36:50 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-11-18 19:36:50 +0800
commitfc6c2cd99b5b24a7957af9df611574ca30fa9bed (patch)
tree0b2c6acb25d4a1fa5047b0d6f82330994e41d404 /mail/importers
parentabda9814844d31daaf4c6355da9a886c69bda9be (diff)
downloadgsoc2013-evolution-fc6c2cd99b5b24a7957af9df611574ca30fa9bed.tar.gz
gsoc2013-evolution-fc6c2cd99b5b24a7957af9df611574ca30fa9bed.tar.zst
gsoc2013-evolution-fc6c2cd99b5b24a7957af9df611574ca30fa9bed.zip
Added back libevolution-importer stuff. (SUBDIRS): Added back importers.
2002-11-18 Not Zed <NotZed@Ximian.com> * Makefile.am (evolution_mail_LDADD): Added back libevolution-importer stuff. (SUBDIRS): Added back importers. * importers/evolution-mbox-importer.c (load_file_fn): build the uri without deprecated funcs. (load_file_fn): dont free/alloc a camel_exception for no obvious purpose. (mbox_factory_fn): use weak_ref rather than destroy. (importer_destroy_cb): fix signature for weak ref notify. (mbox_factory_fn): add cid param. * importers/*.[ch]: ran fix script over everything. * importers/*.server.in.in: Added bonobo activation files. Moved evolution-mail to @LIBEXEC@ as below. * importers/Makefile.am: oaf->bonobo activation stuff. * importers/evolution-outlook-importer.c (outlook_factory_fn): Add component id to callback. svn path=/trunk/; revision=18822
Diffstat (limited to 'mail/importers')
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in21
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in29
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in21
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in29
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in21
-rw-r--r--mail/importers/Makefile.am15
-rw-r--r--mail/importers/evolution-mbox-importer.c38
-rw-r--r--mail/importers/evolution-outlook-importer.c5
8 files changed, 149 insertions, 30 deletions
diff --git a/mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in
new file mode 100644
index 0000000000..8f6a390137
--- /dev/null
+++ b/mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in
@@ -0,0 +1,21 @@
+<oaf_info>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Elm_Intelligent_Importer_Factory"
+ type="exe"
+ location="@LIBEXECDIR@/evolution-mail">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/ObjectFactory:1.0"/>
+ </oaf_attribute>
+</oaf_server>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Elm_Intelligent_Importer"
+ type="factory"
+ location="OAFIID:GNOME_Evolution_Mail_Elm_Intelligent_Importer_Factory">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/Evolution/IntelligentImporter:1.0"/>
+ </oaf_attribute>
+
+</oaf_server>
+</oaf_info>
diff --git a/mail/importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in
new file mode 100644
index 0000000000..995c27a2c9
--- /dev/null
+++ b/mail/importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in
@@ -0,0 +1,29 @@
+<oaf_info>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Mbox_ImporterFactory"
+ type="exe"
+ location="@LIBEXECDIR@/evolution-mail">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/ObjectFactory:1.0"/>
+ </oaf_attribute>
+
+ <oaf_attribute name="description" type="string"
+ _value="Factory to import mbox into Evolution"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Mbox_Importer"
+ type="factory"
+ location="OAFIID:GNOME_Evolution_Mail_Mbox_ImporterFactory">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/Evolution/Importer:1.0"/>
+ </oaf_attribute>
+
+ <oaf_attribute name="evolution:menu-name" type="string"
+ value="MBox (mbox)"/>
+ <oaf_attribute name="description" type="string"
+ _value="Imports mbox files into Evolution"/>
+</oaf_server>
+
+</oaf_info>
diff --git a/mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in
new file mode 100644
index 0000000000..346ad883bc
--- /dev/null
+++ b/mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in
@@ -0,0 +1,21 @@
+<oaf_info>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Netscape_Intelligent_Importer_Factory"
+ type="exe"
+ location="@LIBEXECDIR@/evolution-mail">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/ObjectFactory:1.0"/>
+ </oaf_attribute>
+</oaf_server>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Netscape_Intelligent_Importer"
+ type="factory"
+ location="OAFIID:GNOME_Evolution_Mail_Netscape_Intelligent_Importer_Factory">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/Evolution/IntelligentImporter:1.0"/>
+ </oaf_attribute>
+
+</oaf_server>
+</oaf_info>
diff --git a/mail/importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in
new file mode 100644
index 0000000000..91970c8c02
--- /dev/null
+++ b/mail/importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in
@@ -0,0 +1,29 @@
+<oaf_info>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Outlook_ImporterFactory"
+ type="exe"
+ location="@LIBEXECDIR@/evolution-mail">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/ObjectFactory:1.0"/>
+ </oaf_attribute>
+
+ <oaf_attribute name="description" type="string"
+ _value="Factory to import Outlook Express 4 mails into Evolution"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Outlook_Importer"
+ type="factory"
+ location="OAFIID:GNOME_Evolution_Mail_Outlook_ImporterFactory">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/Evolution/Importer:1.0"/>
+ </oaf_attribute>
+
+ <oaf_attribute name="evolution:menu-name" type="string"
+ value="Outlook Express 4 (.mbx)"/>
+ <oaf_attribute name="description" type="string"
+ _value="Imports Outlook Express 4 files into Evolution"/>
+</oaf_server>
+
+</oaf_info>
diff --git a/mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in
new file mode 100644
index 0000000000..4a5e41d5fe
--- /dev/null
+++ b/mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in
@@ -0,0 +1,21 @@
+<oaf_info>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Pine_Intelligent_Importer_Factory"
+ type="exe"
+ location="@LIBEXECDIR@/evolution-mail">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/ObjectFactory:1.0"/>
+ </oaf_attribute>
+</oaf_server>
+
+<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Pine_Intelligent_Importer"
+ type="factory"
+ location="OAFIID:GNOME_Evolution_Mail_Pine_Intelligent_Importer_Factory">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/Evolution/IntelligentImporter:1.0"/>
+ </oaf_attribute>
+
+</oaf_server>
+</oaf_info>
diff --git a/mail/importers/Makefile.am b/mail/importers/Makefile.am
index aae5b1deae..e1cae100cf 100644
--- a/mail/importers/Makefile.am
+++ b/mail/importers/Makefile.am
@@ -19,12 +19,13 @@ libmbox_la_SOURCES = evolution-mbox-importer.c \
mozilla-status-headers.h
libmbox_la_LDFLAGS = -avoid-version -module
-oafdir = $(datadir)/oaf
-oaf_in_files = GNOME_Evolution_Mail_Mbox_Importer.oaf.in \
- GNOME_Evolution_Mail_Outlook_Importer.oaf.in
-
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-EXTRA_DIST = $(oaf_in_files) $(oaf_DATA)
+serverdir = $(datadir)/bonobo/servers
+server_in_files = GNOME_Evolution_Mail_Mbox_Importer.server.in.in \
+ GNOME_Evolution_Mail_Outlook_Importer.server.in.in
+server_DATA = $(server_in_files:.server.in.in=.server)
+$(server_in_files:.server.in.in=.server.in): $(server_in_files)
+ sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@
+
+EXTRA_DIST = $(server_in_files) $(server_DATA)
@INTLTOOL_SERVER_RULE@
diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c
index faeadbcf34..f90d7a2f4e 100644
--- a/mail/importers/evolution-mbox-importer.c
+++ b/mail/importers/evolution-mbox-importer.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-generic-factory.h>
@@ -161,7 +162,7 @@ process_item_fn (EvolutionImporter *eimporter,
if (info)
camel_message_info_free (info);
- camel_object_unref (CAMEL_OBJECT (msg));
+ camel_object_unref (msg);
if (camel_exception_is_set (ex)) {
g_warning ("Failed message %d", mbi->num);
done = TRUE;
@@ -214,23 +215,22 @@ support_format_fn (EvolutionImporter *importer,
}
static void
-importer_destroy_cb (GtkObject *object,
- MboxImporter *mbi)
+importer_destroy_cb (void *data, GObject *object)
{
- MailImporter *importer;
+ MboxImporter *mbi = data;
+ MailImporter *importer = data;
- importer = (MailImporter *) mbi;
if (importer->frozen) {
camel_folder_sync (importer->folder, FALSE, NULL);
camel_folder_thaw (importer->folder);
}
if (importer->folder)
- camel_object_unref (CAMEL_OBJECT (importer->folder));
+ camel_object_unref (importer->folder);
g_free (mbi->filename);
if (mbi->mp)
- camel_object_unref (CAMEL_OBJECT (mbi->mp));
+ camel_object_unref (mbi->mp);
g_free (mbi);
}
@@ -314,10 +314,8 @@ load_file_fn (EvolutionImporter *eimporter,
const char *name;
BonoboListener *listener;
CamelException *ex;
-
- tmp = gnome_util_prepend_user_home ("evolution/local");
- homedir = g_strconcat ("file://", tmp, NULL);
- g_free (tmp);
+
+ homedir = g_strdup_printf("file://%s/evolution/local", g_get_home_dir());
fullpath = e_path_to_physical (homedir, folderpath);
ex = camel_exception_new ();
@@ -332,17 +330,15 @@ load_file_fn (EvolutionImporter *eimporter,
name = folderpath;
} else {
name += 1;
- parent = g_dirname (folderpath);
+ parent = g_path_get_dirname (folderpath);
}
listener = bonobo_listener_new (NULL, NULL);
- gtk_signal_connect (GTK_OBJECT (listener), "event-notify",
- GTK_SIGNAL_FUNC (folder_created_cb),
- importer);
+ g_signal_connect((listener), "event-notify",
+ G_CALLBACK (folder_created_cb),
+ importer);
mail_importer_create_folder (parent, name, NULL, listener);
- camel_exception_free (ex);
- ex = camel_exception_new ();
importer->folder = NULL;
g_print ("No folder yet\n");
delayed = TRUE;
@@ -365,7 +361,7 @@ load_file_fn (EvolutionImporter *eimporter,
return TRUE;
fail:
- camel_object_unref (CAMEL_OBJECT (mbi->mp));
+ camel_object_unref (mbi->mp);
mbi->mp = NULL;
return FALSE;
@@ -373,6 +369,7 @@ load_file_fn (EvolutionImporter *eimporter,
static BonoboObject *
mbox_factory_fn (BonoboGenericFactory *_factory,
+ const char *cid,
void *closure)
{
EvolutionImporter *importer;
@@ -381,9 +378,8 @@ mbox_factory_fn (BonoboGenericFactory *_factory,
mbox = g_new0 (MboxImporter, 1);
importer = evolution_importer_new (support_format_fn, load_file_fn,
process_item_fn, NULL, mbox);
- gtk_signal_connect (GTK_OBJECT (importer), "destroy",
- GTK_SIGNAL_FUNC (importer_destroy_cb), mbox);
-
+ g_object_weak_ref(G_OBJECT(importer), importer_destroy_cb, mbox);
+
return BONOBO_OBJECT (importer);
}
diff --git a/mail/importers/evolution-outlook-importer.c b/mail/importers/evolution-outlook-importer.c
index 977d610055..8079ca3e33 100644
--- a/mail/importers/evolution-outlook-importer.c
+++ b/mail/importers/evolution-outlook-importer.c
@@ -281,6 +281,7 @@ load_file_fn (EvolutionImporter *eimporter,
static BonoboObject *
outlook_factory_fn (BonoboGenericFactory *_factory,
+ const char *cid,
void *closure)
{
EvolutionImporter *importer;
@@ -290,8 +291,8 @@ outlook_factory_fn (BonoboGenericFactory *_factory,
importer = evolution_importer_new (support_format_fn, load_file_fn,
process_item_fn, NULL, oli);
- gtk_signal_connect (GTK_OBJECT (importer), "destroy",
- GTK_SIGNAL_FUNC (importer_destroy_cb), oli);
+ g_signal_connect((importer), "destroy",
+ G_CALLBACK (importer_destroy_cb), oli);
return BONOBO_OBJECT (importer);
}