aboutsummaryrefslogtreecommitdiffstats
path: root/shell/importer/importer.c
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 /shell/importer/importer.c
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 'shell/importer/importer.c')
-rw-r--r--shell/importer/importer.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/shell/importer/importer.c b/shell/importer/importer.c
index 5286a1b04d..a82bf72db2 100644
--- a/shell/importer/importer.c
+++ b/shell/importer/importer.c
@@ -60,6 +60,15 @@ typedef struct _ImportData {
char *choosen_iid;
} ImportData;
+#define IMPORTER_DEBUG
+#ifdef IMPORTER_DEBUG
+#define IN g_print ("=====> %s (%d)\n", __FUNCTION__, __LINE__)
+#define OUT g_print ("<==== %s (%d)\n", __FUNCTION__, __LINE__)
+#else
+#define IN
+#define OUT
+#endif
+
/* Some HTML helper functions from mail/mail-config-gui.c */
static void
html_size_req (GtkWidget *widget,
@@ -149,6 +158,7 @@ import_cb (EvolutionImporterListener *listener,
ImporterComponentData *icd = (ImporterComponentData *) data;
char *label;
+ IN;
if (icd->stop != TRUE) {
if (result == EVOLUTION_IMPORTER_NOT_READY) {
/* Importer isn't ready yet.
@@ -163,11 +173,13 @@ import_cb (EvolutionImporterListener *listener,
gtk_main_iteration ();
gtk_timeout_add (5000, importer_timeout_fn, data);
+ OUT;
return;
}
if (result == EVOLUTION_IMPORTER_BUSY) {
gtk_timeout_add (5000, importer_timeout_fn, data);
+ OUT;
return;
}
@@ -181,6 +193,7 @@ import_cb (EvolutionImporterListener *listener,
g_idle_add_full (G_PRIORITY_LOW, importer_timeout_fn,
data, NULL);
+ OUT;
return;
}
}
@@ -191,6 +204,8 @@ import_cb (EvolutionImporterListener *listener,
bonobo_object_unref (BONOBO_OBJECT (icd->listener));
bonobo_object_unref (BONOBO_OBJECT (icd->client));
g_free (icd);
+
+ OUT;
}
static gboolean
@@ -199,6 +214,7 @@ importer_timeout_fn (gpointer data)
ImporterComponentData *icd = (ImporterComponentData *) data;
char *label;
+ IN;
label = g_strdup_printf (_("Importing %s\nImporting item %d."),
icd->filename, icd->item);
gtk_label_set_text (GTK_LABEL (icd->contents), label);
@@ -207,6 +223,7 @@ importer_timeout_fn (gpointer data)
gtk_main_iteration ();
evolution_importer_client_process_item (icd->client, icd->listener);
+ OUT;
return FALSE;
}
@@ -338,7 +355,8 @@ start_import (const char *filename,
icd->client = evolution_importer_client_new_from_id (real_iid);
g_free (real_iid);
- if (evolution_importer_client_load_file (icd->client, filename) == FALSE) {
+ /* NULL for folderpath means use Inbox */
+ if (evolution_importer_client_load_file (icd->client, filename, NULL) == FALSE) {
label = g_strdup_printf (_("Error loading %s"), filename);
gtk_label_set_text (GTK_LABEL (icd->contents), label);
g_free (label);