[evolution-patches] patch for passing folder_type from shell to importers



This is needed for the calendar importer which does not import anything
right now due to it not knowing what type (calendar or tasks) the folder
is.

This seems a better approach than contacting the shell from the
importers individually.

cheers
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1363
diff -u -p -r1.1363 ChangeLog
--- ChangeLog	1 Apr 2003 06:58:25 -0000	1.1363
+++ ChangeLog	1 Apr 2003 16:58:40 -0000
@@ -1,3 +1,9 @@
+2003-04-01  Rodrigo Moya <rodrigo ximian com>
+
+	* backend/ebook/evolution-ldif-importer.c (load_file_fn):
+	* backend/ebook/evolution-vcard-importer.c (load_file_fn): added
+	"folder_type" parameter to EvolutionImporterLoadFileFn.
+
 2003-03-31  Chris Toshok  <toshok ximian com>
 
 	* backend/ebook/e-book-util.c (get_local_book_uri): new function,
Index: backend/ebook/evolution-ldif-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/backend/ebook/evolution-ldif-importer.c,v
retrieving revision 1.11
diff -u -p -r1.11 evolution-ldif-importer.c
--- backend/ebook/evolution-ldif-importer.c	27 Mar 2003 05:21:18 -0000	1.11
+++ backend/ebook/evolution-ldif-importer.c	1 Apr 2003 16:58:41 -0000
@@ -546,6 +546,7 @@ static gboolean
 load_file_fn (EvolutionImporter *importer,
 	      const char *filename,
 	      const char *uri,
+	      const char *folder_type,
 	      void *closure)
 {
 	LDIFImporter *gci;
Index: backend/ebook/evolution-vcard-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/backend/ebook/evolution-vcard-importer.c,v
retrieving revision 1.17
diff -u -p -r1.17 evolution-vcard-importer.c
--- backend/ebook/evolution-vcard-importer.c	27 Mar 2003 05:21:18 -0000	1.17
+++ backend/ebook/evolution-vcard-importer.c	1 Apr 2003 16:58:41 -0000
@@ -169,6 +169,7 @@ static gboolean
 load_file_fn (EvolutionImporter *importer,
 	      const char *filename,
 	      const char *uri,
+	      const char *folder_type,
 	      void *closure)
 {
 	VCardImporter *gci;
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1696
diff -u -p -r1.1696 ChangeLog
--- ChangeLog	1 Apr 2003 16:06:12 -0000	1.1696
+++ ChangeLog	1 Apr 2003 16:59:43 -0000
@@ -1,6 +1,11 @@
 2003-04-01  Rodrigo Moya <rodrigo ximian com>
 
 	* importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn):
+	added "folder_type" parameter to EvolutionImporterLoadFileFn.
+
+2003-04-01  Rodrigo Moya <rodrigo ximian com>
+
+	* importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn):
 	added filename (tasks.ics/calendar.ics) to the URI if it does not
 	contain it.
 
Index: importers/icalendar-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/importers/icalendar-importer.c,v
retrieving revision 1.17
diff -u -p -r1.17 icalendar-importer.c
--- importers/icalendar-importer.c	1 Apr 2003 16:06:15 -0000	1.17
+++ importers/icalendar-importer.c	1 Apr 2003 16:59:43 -0000
@@ -276,6 +276,7 @@ static gboolean
 load_file_fn (EvolutionImporter *importer,
 	      const char *filename,
 	      const char *physical_uri,
+	      const char *folder_type,
 	      void *closure)
 {
 	char *contents;
@@ -414,6 +415,7 @@ static gboolean
 vcal_load_file_fn (EvolutionImporter *importer,
 		   const char *filename,
 		   const char *physical_uri,
+		   const char *folder_type,
 		   void *closure)
 {
 	gboolean ret = FALSE;
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2671
diff -u -p -r1.2671 ChangeLog
--- ChangeLog	1 Apr 2003 06:02:19 -0000	1.2671
+++ ChangeLog	1 Apr 2003 17:00:45 -0000
@@ -1,3 +1,14 @@
+2003-04-01  Rodrigo Moya <rodrigo ximian com>
+
+	* importers/evolution-mbox-importer.c (load_file_fn):
+	* importers/evolution-outlook-importer.c (load_file_fn): added
+        "folder_type" parameter to EvolutionImporterLoadFileFn.
+
+	* importers/elm-importer.c (elm_import_file): pass empty string for
+	"folder_type" argument to GNOME_Evolution_Importer_loadFile.
+	* importers/pine-importer.c (pine_import_file): ditto.
+	* importers/netscape-importer.c (netscape_import_file): ditto.
+
 2003-04-01  Not Zed  <NotZed Ximian com>
 
 	* mail-display.c (mail_display_redisplay): if we're called and the
Index: importers/elm-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/importers/elm-importer.c,v
retrieving revision 1.6
diff -u -p -r1.6 elm-importer.c
--- importers/elm-importer.c	20 Mar 2003 10:17:24 -0000	1.6
+++ importers/elm-importer.c	1 Apr 2003 17:00:45 -0000
@@ -173,7 +173,7 @@ elm_import_file (ElmImporter *importer,
 
 	CORBA_exception_init(&ev);
 
-	result = GNOME_Evolution_Importer_loadFile (importer->importer, path, uri, &ev);
+	result = GNOME_Evolution_Importer_loadFile (importer->importer, path, uri, "", &ev);
 	g_free(uri);
 	if (ev._major != CORBA_NO_EXCEPTION || result == FALSE) {
 		g_warning ("Exception here: %s", CORBA_exception_id (&ev));
Index: importers/evolution-mbox-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/importers/evolution-mbox-importer.c,v
retrieving revision 1.29
diff -u -p -r1.29 evolution-mbox-importer.c
--- importers/evolution-mbox-importer.c	20 Mar 2003 10:17:25 -0000	1.29
+++ importers/evolution-mbox-importer.c	1 Apr 2003 17:00:45 -0000
@@ -241,6 +241,7 @@ static gboolean
 load_file_fn (EvolutionImporter *eimporter,
 	      const char *filename,
 	      const char *uri,
+	      const char *folder_type,
 	      void *closure)
 {
 	MboxImporter *mbi;
Index: importers/evolution-outlook-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/importers/evolution-outlook-importer.c,v
retrieving revision 1.9
diff -u -p -r1.9 evolution-outlook-importer.c
--- importers/evolution-outlook-importer.c	20 Mar 2003 10:17:25 -0000	1.9
+++ importers/evolution-outlook-importer.c	1 Apr 2003 17:00:45 -0000
@@ -225,6 +225,7 @@ static gboolean
 load_file_fn (EvolutionImporter *eimporter,
 	      const char *filename,
 	      const char *uri,
+	      const char *folder_type,
 	      void *closure)
 {
 	OutlookImporter *oli;
Index: importers/netscape-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/importers/netscape-importer.c,v
retrieving revision 1.10
diff -u -p -r1.10 netscape-importer.c
--- importers/netscape-importer.c	20 Mar 2003 10:17:25 -0000	1.10
+++ importers/netscape-importer.c	1 Apr 2003 17:00:46 -0000
@@ -1766,7 +1766,7 @@ netscape_import_file (NsImporter *import
 	if (!uri)
 		return FALSE;
 
-	result = GNOME_Evolution_Importer_loadFile (importer->importer, path, uri, &ev);
+	result = GNOME_Evolution_Importer_loadFile (importer->importer, path, uri, "", &ev);
 	g_free(uri);
 	if (ev._major != CORBA_NO_EXCEPTION || result == FALSE) {
 		g_warning ("Exception here: %s", CORBA_exception_id (&ev));
Index: importers/pine-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/importers/pine-importer.c,v
retrieving revision 1.7
diff -u -p -r1.7 pine-importer.c
--- importers/pine-importer.c	20 Mar 2003 10:17:25 -0000	1.7
+++ importers/pine-importer.c	1 Apr 2003 17:00:46 -0000
@@ -302,7 +302,7 @@ pine_import_file (PineImporter *importer
 		return FALSE;
 	}
 
-	result = GNOME_Evolution_Importer_loadFile (importer->importer, path, uri, &ev);
+	result = GNOME_Evolution_Importer_loadFile (importer->importer, path, uri, "", &ev);
 	g_free(uri);
 	if (ev._major != CORBA_NO_EXCEPTION || result == FALSE) {
 		g_warning ("Exception here: %s\n%s, %s", CORBA_exception_id (&ev), path, folderpath);
? Evolution-Wombat-common.c
? Evolution-Wombat-skels.c
? Evolution-Wombat-stubs.c
? Evolution-Wombat.h
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1220
diff -u -p -r1.1220 ChangeLog
--- ChangeLog	1 Apr 2003 04:11:00 -0000	1.1220
+++ ChangeLog	1 Apr 2003 17:01:53 -0000
@@ -1,3 +1,17 @@
+2003-04-01  Rodrigo Moya <rodrigo ximian com>
+
+	* importer/GNOME_Evolution_Importer.idl:
+	* importer/evolution-importer.[ch]: added "foldertype" argument to
+	GNOME::Evolution::Importer.
+
+	* importer/evolution-importer-client.[ch]
+	(evolution_importer_client_load_file): added "folder_type" argument
+	and use it in the call to GNOME_Evolution_Importer_loadFile.
+
+	* e-shell-importer.c (start_import): added "folder_type" argument and
+	use it in the call to evolution_importer_client_load_file.
+	(folder_selected): pass in the "folder_type" argument to start_import,
+
 2003-04-01  Not Zed  <NotZed Ximian com>
 
 	[#40474]
Index: e-shell-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-importer.c,v
retrieving revision 1.52
diff -u -p -r1.52 e-shell-importer.c
--- e-shell-importer.c	20 Mar 2003 10:07:48 -0000	1.52
+++ e-shell-importer.c	1 Apr 2003 17:01:53 -0000
@@ -478,7 +478,8 @@ show_error (const char *message,
 static void
 start_import (const char *physical_uri,
 	      const char *filename,
-	      const char *iid)
+	      const char *iid,
+	      const char *folder_type)
 {
 	ImporterComponentData *icd;
 	char *label;
@@ -546,7 +547,7 @@ start_import (const char *physical_uri,
 	}
 	g_free (real_iid);
 
-	if (evolution_importer_client_load_file (icd->client, filename, physical_uri) == FALSE) {
+	if (evolution_importer_client_load_file (icd->client, filename, physical_uri, folder_type) == FALSE) {
 		label = g_strdup_printf (_("Error loading %s"), filename);
 		show_error (label, _("Evolution Error"));
 
@@ -966,7 +967,7 @@ folder_selected (EShellFolderSelectionDi
 	gtk_widget_destroy (data->dialog);
 	gtk_widget_hide (GTK_WIDGET (dialog));
 
-	start_import (e_folder_get_physical_uri (folder), filename, iid);
+	start_import (e_folder_get_physical_uri (folder), filename, iid, e_folder_get_type_string (folder));
 
 	g_free (iid);
 	g_free (filename);
Index: importer/GNOME_Evolution_Importer.idl
===================================================================
RCS file: /cvs/gnome/evolution/shell/importer/GNOME_Evolution_Importer.idl,v
retrieving revision 1.8
diff -u -p -r1.8 GNOME_Evolution_Importer.idl
--- importer/GNOME_Evolution_Importer.idl	23 Jun 2001 08:51:56 -0000	1.8
+++ importer/GNOME_Evolution_Importer.idl	1 Apr 2003 17:01:53 -0000
@@ -72,6 +72,7 @@ module Evolution {
 		 * loadFile:
 		 * @filename: The filename of the file.
 		 * @folderpath: The full pathname to the folder.
+		 * @foldertpe: The type of the folder to import to.
 		 * 
 		 * Loads the file and prepares an Importer object that can
 		 * process files of this type.
@@ -79,7 +80,8 @@ module Evolution {
 		 * Returns: An Importer object.
 		 */
 		boolean loadFile (in string filename,
-				  in string folderpath);
+				  in string folderpath,
+				  in string foldertype);
 	};
 
 	interface IntelligentImporter : Bonobo::Unknown {
Index: importer/evolution-importer-client.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/importer/evolution-importer-client.c,v
retrieving revision 1.15
diff -u -p -r1.15 evolution-importer-client.c
--- importer/evolution-importer-client.c	20 Mar 2003 10:07:51 -0000	1.15
+++ importer/evolution-importer-client.c	1 Apr 2003 17:01:54 -0000
@@ -152,6 +152,7 @@ evolution_importer_client_support_format
  * @client: The EvolutionImporterClient.
  * @filename: The file to load.
  * @physical_uri: The physical URI of the folder to import data into.
+ * @folder_type: The type of the folder represented by @physical_uri.
  *
  * Loads and initialises the importer.
  *
@@ -160,7 +161,8 @@ evolution_importer_client_support_format
 gboolean
 evolution_importer_client_load_file (EvolutionImporterClient *client,
 				     const char *filename,
-				     const char *physical_uri)
+				     const char *physical_uri,
+				     const char *folder_type)
 {
 	GNOME_Evolution_Importer corba_importer;
 	gboolean result;
@@ -175,6 +177,7 @@ evolution_importer_client_load_file (Evo
 	result = GNOME_Evolution_Importer_loadFile (corba_importer,
 						    filename,
 						    physical_uri ? physical_uri : "",
+						    folder_type ? folder_type : "",
 						    &ev);
 	if (ev._major != CORBA_NO_EXCEPTION) {
 		g_warning ("Oh there *WAS* an exception.\nIt was %s",
Index: importer/evolution-importer-client.h
===================================================================
RCS file: /cvs/gnome/evolution/shell/importer/evolution-importer-client.h,v
retrieving revision 1.12
diff -u -p -r1.12 evolution-importer-client.h
--- importer/evolution-importer-client.h	20 Mar 2003 10:07:51 -0000	1.12
+++ importer/evolution-importer-client.h	1 Apr 2003 17:01:54 -0000
@@ -61,7 +61,8 @@ gboolean evolution_importer_client_suppo
 						   const char *filename);
 gboolean evolution_importer_client_load_file (EvolutionImporterClient *client,
 					      const char *filename,
-					      const char *physical_uri);
+					      const char *physical_uri,
+					      const char *folder_type);
 void evolution_importer_client_process_item (EvolutionImporterClient *client,
 					     EvolutionImporterListener *listener);
 const char *evolution_importer_client_get_error (EvolutionImporterClient *client);
Index: importer/evolution-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/importer/evolution-importer.c,v
retrieving revision 1.11
diff -u -p -r1.11 evolution-importer.c
--- importer/evolution-importer.c	20 Mar 2003 10:07:51 -0000	1.11
+++ importer/evolution-importer.c	1 Apr 2003 17:01:54 -0000
@@ -72,6 +72,7 @@ static CORBA_boolean
 impl_GNOME_Evolution_Importer_loadFile (PortableServer_Servant servant,
 					const CORBA_char *filename,
 					const CORBA_char *physical_uri,
+					const CORBA_char *folder_type,
 					CORBA_Environment *ev)
 {
 	EvolutionImporter *importer;
@@ -81,7 +82,7 @@ impl_GNOME_Evolution_Importer_loadFile (
 	priv = importer->priv;
 
 	if (priv->load_file_fn != NULL)
-		return (priv->load_file_fn) (importer, filename, physical_uri, priv->closure);
+		return (priv->load_file_fn) (importer, filename, physical_uri, folder_type, priv->closure);
 	else
 		return FALSE;
 }
Index: importer/evolution-importer.h
===================================================================
RCS file: /cvs/gnome/evolution/shell/importer/evolution-importer.h,v
retrieving revision 1.13
diff -u -p -r1.13 evolution-importer.h
--- importer/evolution-importer.h	20 Mar 2003 10:07:51 -0000	1.13
+++ importer/evolution-importer.h	1 Apr 2003 17:01:54 -0000
@@ -48,6 +48,7 @@ typedef gboolean (* EvolutionImporterSup
 typedef gboolean (* EvolutionImporterLoadFileFn) (EvolutionImporter *importer,
 						  const char *filename,
 						  const char *physical_uri,
+						  const char *folder_type,
 						  void *closure);
 typedef void (* EvolutionImporterProcessItemFn) (EvolutionImporter *importer,
 						 CORBA_Object listener,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]