aboutsummaryrefslogtreecommitdiffstats
path: root/mail/importers
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-03-23 10:09:29 +0800
committerIain Holmes <iain@src.gnome.org>2001-03-23 10:09:29 +0800
commit35c7cc901818b753634113241f1d85231d4624c3 (patch)
tree36c225a7d4a2ed0f4f4ba6931fda38827134e1fe /mail/importers
parent01e19198a88f491251dd2c3d824bd771eebc3e3e (diff)
downloadgsoc2013-evolution-35c7cc901818b753634113241f1d85231d4624c3.tar
gsoc2013-evolution-35c7cc901818b753634113241f1d85231d4624c3.tar.gz
gsoc2013-evolution-35c7cc901818b753634113241f1d85231d4624c3.tar.bz2
gsoc2013-evolution-35c7cc901818b753634113241f1d85231d4624c3.tar.lz
gsoc2013-evolution-35c7cc901818b753634113241f1d85231d4624c3.tar.xz
gsoc2013-evolution-35c7cc901818b753634113241f1d85231d4624c3.tar.zst
gsoc2013-evolution-35c7cc901818b753634113241f1d85231d4624c3.zip
Fix some warnings, Allow the importers to import into any folder. Update
Fix some warnings, Allow the importers to import into any folder. Update all importers for this change. Don't emit the create_folder callback if the folder to be created already exists. This should fix the libibex crash when importing. svn path=/trunk/; revision=8912
Diffstat (limited to 'mail/importers')
-rw-r--r--mail/importers/Makefile.am8
-rw-r--r--mail/importers/evolution-mbox-importer.c6
-rw-r--r--mail/importers/evolution-outlook-importer.c6
-rw-r--r--mail/importers/netscape-importer.c14
4 files changed, 28 insertions, 6 deletions
diff --git a/mail/importers/Makefile.am b/mail/importers/Makefile.am
index ee26f19215..f93115f950 100644
--- a/mail/importers/Makefile.am
+++ b/mail/importers/Makefile.am
@@ -1,7 +1,7 @@
importersdir = $(pkglibdir)/evolution-mail-importers/$(VERSION)
importers_LTLIBRARIES = liboutlook.la libmbox.la libiinetscape.la \
- libiipine.la
+ libiipine.la libiielm.la
INCLUDES = -I.. \
-I$(srcdir)/.. \
@@ -25,11 +25,15 @@ libiinetscape_la_LDFLAGS = -version-info 0:0:0
libiipine_la_SOURCES = pine-importer.c
libiipine_la_LDFLAGS = -version-info 0:0:0
+libiielm_la_SOURCES = elm-importer.c
+libiielm_la_LDFLAGS = -version-info 0:0:0
+
oafdir = $(datadir)/oaf
oaf_in_files = GNOME_Evolution_Mail_Mbox_Importer.oaf.in \
GNOME_Evolution_Mail_Outlook_Importer.oaf.in \
GNOME_Evolution_Mail_Netscape_Intelligent_Importer.oaf.in \
- GNOME_Evolution_Mail_Pine_Intelligent_Importer.oaf.in
+ GNOME_Evolution_Mail_Pine_Intelligent_Importer.oaf.in \
+ GNOME_Evolution_Mail_Elm_Intelligent_Importer.oaf.in
oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c
index b39691f0dc..aa701d9f25 100644
--- a/mail/importers/evolution-mbox-importer.c
+++ b/mail/importers/evolution-mbox-importer.c
@@ -171,6 +171,7 @@ importer_destroy_cb (GtkObject *object,
static gboolean
load_file_fn (EvolutionImporter *eimporter,
const char *filename,
+ const char *folderpath,
void *closure)
{
MboxImporter *mbi;
@@ -196,7 +197,10 @@ load_file_fn (EvolutionImporter *eimporter,
}
importer->mstream = NULL;
- importer->folder = mail_tool_get_local_inbox (NULL);
+ if (folderpath == NULL)
+ importer->folder = mail_tool_get_local_inbox (NULL);
+ else
+ importer->folder = mail_tool_uri_to_folder (folderpath, NULL);
if (importer->folder == NULL){
g_print ("Bad folder\n");
diff --git a/mail/importers/evolution-outlook-importer.c b/mail/importers/evolution-outlook-importer.c
index a92f5086ab..7f8a361697 100644
--- a/mail/importers/evolution-outlook-importer.c
+++ b/mail/importers/evolution-outlook-importer.c
@@ -218,6 +218,7 @@ importer_destroy_cb (GtkObject *object,
static gboolean
load_file_fn (EvolutionImporter *eimporter,
const char *filename,
+ const char *folderpath,
void *closure)
{
OutlookImporter *oli;
@@ -256,7 +257,10 @@ load_file_fn (EvolutionImporter *eimporter,
importer->mstream = NULL;
- importer->folder = mail_tool_get_local_inbox (NULL);
+ if (folderpath == NULL)
+ importer->folder = mail_tool_get_local_inbox (NULL);
+ else
+ importer->folder = mail_tool_uri_to_folder (folderpath);
if (importer->folder == NULL){
g_warning ("Bad folder");
diff --git a/mail/importers/netscape-importer.c b/mail/importers/netscape-importer.c
index 8752ce4de9..9a6ec5eac9 100644
--- a/mail/importers/netscape-importer.c
+++ b/mail/importers/netscape-importer.c
@@ -44,6 +44,8 @@
#include <importer/evolution-intelligent-importer.h>
#include <importer/GNOME_Evolution_Importer.h>
+#include <evolution-storage.h>
+
#include "mail-importer.h"
#include "mail-tools.h"
@@ -52,6 +54,7 @@ static char *nsmail_dir = NULL;
extern char *evolution_dir;
#define NETSCAPE_INTELLIGENT_IMPORTER_IID "OAFIID:GNOME_Evolution_Mail_Netscape_Intelligent_Importer_Factory"
+#define MBOX_IMPORTER_IID "OAFIID:GNOME_Evolution_Mail_Mbox_ImporterFactory"
#define KEY "netscape-mail-imported"
/*#define SUPER_IMPORTER_DEBUG*/
@@ -229,7 +232,7 @@ netscape_import_file (NetscapeImporter *importer,
char *protocol;
CamelException *ex;
CamelFolder *folder;
-
+
/* Do import */
d(g_warning ("Importing %s as %s\n", filename, fullpath));
@@ -242,6 +245,8 @@ netscape_import_file (NetscapeImporter *importer,
return;
}
+ g_free (protocol);
+
if (folder == NULL) {
g_warning ("Folder for %s is NULL", fullpath);
camel_exception_free (ex);
@@ -267,6 +272,7 @@ netscape_dir_created (BonoboListener *listener,
CORBA_Environment *ev,
NetscapeImporter *importer)
{
+ EvolutionStorageResult storage_result;
NetscapeCreateDirectoryData *data;
GList *l;
GNOME_Evolution_Storage_FolderResult *result;
@@ -277,8 +283,11 @@ netscape_dir_created (BonoboListener *listener,
}
result = event_data->_value;
+ storage_result = result->result;
fullpath = result->path;
+ g_warning ("path: %s\tresult: %d", fullpath, storage_result);
+
l = importer->dir_list;
importer->dir_list = g_list_remove_link (importer->dir_list, l);
data = l->data;
@@ -286,7 +295,8 @@ netscape_dir_created (BonoboListener *listener,
/* Import the file */
/* We got the folder, so try to import the file into it. */
- netscape_import_file (data->importer, data->path, fullpath);
+ if (fullpath != NULL || *fullpath != '\0')
+ netscape_import_file (data->importer, data->path, fullpath);
g_free (data->parent);
g_free (data->path);