[nautilus-actions] Refactor NAIExporter interface



commit 4f67441d6d11dcdce48f6674db780ac6c55b9363
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Mar 1 23:05:04 2010 +0100

    Refactor NAIExporter interface

 ChangeLog                        |   16 ++++
 po/POTFILES.in                   |    1 +
 src/api/na-iexporter.h           |   64 +++++++++++------
 src/core/na-export-format.c      |   29 +++++++-
 src/core/na-export-format.h      |    1 +
 src/core/na-exporter.c           |  152 ++++++++++++++++++++++++++++++++------
 src/core/na-exporter.h           |    6 +-
 src/core/na-iexporter.c          |   18 ++---
 src/core/na-importer.c           |    4 +-
 src/io-xml/naxml-provider.c      |   28 +++++---
 src/nact/nact-assistant-export.c |    6 +-
 src/nact/nact-clipboard.c        |    9 ++-
 12 files changed, 257 insertions(+), 77 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index be0bc3c..5dc277b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2009-03-01 Pierre Wieser <pwieser trychlos org>
 
+	* po/POTFILES.in: Add src/core/na-exporter.c file.
+
+	* src/api/na-iexporter.h: Refactor NAIExporter interface.
+
+	* src/core/na-export-format.c:
+	* src/core/na-export-format.h
+	(na_export_format_get_exporter): New function.
+
+	* src/core/na-exporter.c:
+	* src/core/na-exporter.h:
+	* src/core/na-iexporter.c:
+	* src/core/na-importer.c:
+	* src/io-xml/naxml-provider.c:
+	* src/nact/nact-assistant-export.c:
+	* src/nact/nact-clipboard.c: Updated accordingly.
+
 	* src/api/na-iexporter.h:
 	* src/core/na-export-format.c:
 	* src/core/na-export-format.h:
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b5c1b64..452258a 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,4 +1,5 @@
 data/nautilus-actions.schemas.in
+src/core/na-exporter.c
 src/core/na-iabout.c
 src/core/na-importer-ask.c
 src/core/na-importer-ask.ui
diff --git a/src/api/na-iexporter.h b/src/api/na-iexporter.h
index 70d3423..f49277b 100644
--- a/src/api/na-iexporter.h
+++ b/src/api/na-iexporter.h
@@ -52,11 +52,14 @@ G_BEGIN_DECLS
 
 typedef struct NAIExporter                 NAIExporter;
 typedef struct NAIExporterFileParms        NAIExporterFileParms;
+typedef struct NAIExporterBufferParms      NAIExporterBufferParms;
 
 typedef struct NAIExporterInterfacePrivate NAIExporterInterfacePrivate;
 
 /* When listing available export formats, the instance returns a GList
- * of these structures
+ * of these structures.
+ * This structure must be implemented by each #NAIExporter implementation
+ * (see e.g. io-xml/naxml-provider.c)
  */
 typedef struct {
 	gchar *format;					/* format identifier (ascii) */
@@ -78,7 +81,16 @@ typedef struct {
 	 *
 	 * Defaults to 1.
 	 */
-	guint                 ( *get_version )( const NAIExporter *instance );
+	guint                     ( *get_version )( const NAIExporter *instance );
+
+	/**
+	 * get_name:
+	 * @instance: this #NAIExporter instance.
+	 *
+	 * Returns: the name to be displayed for this instance, as a
+	 * newly allocated string which should be g_free() by the caller.
+	 */
+	gchar *                   ( *get_name )   ( const NAIExporter *instance );
 
 	/**
 	 * get_formats:
@@ -102,32 +114,27 @@ typedef struct {
 	/**
 	 * to_file:
 	 * @instance: this #NAIExporter instance.
-	 * @item: a #NAObjectItem-derived object.
-	 * @uri: the target directory URI.
-	 * @format: the target format.
-	 * @fname: the place where allocate a new string to store the output
-	 * filename URI.
+	 * @parms: a #NAIExporterFileParms structure.
 	 *
-	 * Exports the specified @item to the target @uri in the required
-	 * @format.
+	 * Exports the specified 'exported' to the target 'folder' in the required
+	 * 'format'.
 	 *
 	 * Returns: the status of the operation.
 	 */
-	guint                 ( *to_file )    ( const NAIExporter *instance, const NAObjectItem *item, const gchar *uri, const gchar *format, gchar **fname );
+	guint                     ( *to_file )    ( const NAIExporter *instance, NAIExporterFileParms *parms );
 
 	/**
 	 * to_buffer:
 	 * @instance: this #NAIExporter instance.
-	 * @item: a #NAObjectItem-derived object.
-	 * @format: the target format.
-	 * @buffer: the place where allocate a new buffer to store the output.
+	 * @parms: a #NAIExporterFileParms structure.
 	 *
-	 * Exports the specified @item to the target @buffer in the required
-	 * @format.
+	 * Exports the specified 'exported' to a newly allocated 'buffer' in
+	 * the required 'format'. The allocated 'buffer' should be g_free()
+	 * by the caller.
 	 *
 	 * Returns: the status of the operation.
 	 */
-	guint                 ( *to_buffer )  ( const NAIExporter *instance, const NAObjectItem *item, const gchar *format, gchar **buffer );
+	guint                     ( *to_buffer )  ( const NAIExporter *instance, NAIExporterBufferParms *parms );
 }
 	NAIExporterInterface;
 
@@ -146,12 +153,25 @@ enum {
  * ... when exporting to a file
  */
 struct NAIExporterFileParms {
-	guint              version;			/* i 1: version of this structure */
-	NAObjectItem      *exported;		/* i 1: exported NAObjectItem-derived object */
-	gchar             *folder;			/* i 1: URI of the target folder */
-	GQuark             format;			/* i 1: export format as a GQuark */
-	gchar             *basename;		/*  o1: basename of the exported file */
-	GSList            *messages;		/* io1: a #GSList list of localized strings;
+	guint         version;				/* i 1: version of this structure */
+	NAObjectItem *exported;				/* i 1: exported NAObjectItem-derived object */
+	gchar        *folder;				/* i 1: URI of the target folder */
+	GQuark        format;				/* i 1: export format as a GQuark */
+	gchar        *basename;				/*  o1: basename of the exported file */
+	GSList       *messages;				/* io1: a #GSList list of localized strings;
+										 *       the provider may append messages to this list,
+										 *       but shouldn't reinitialize it. */
+};
+
+/* parameters via a structure
+ * ... when exporting to a buffer
+ */
+struct NAIExporterBufferParms {
+	guint         version;				/* i 1: version of this structure */
+	NAObjectItem *exported;				/* i 1: exported NAObjectItem-derived object */
+	GQuark        format;				/* i 1: export format as a GQuark */
+	gchar        *buffer;				/*  o1: buffer which contains the exported object */
+	GSList       *messages;				/* io1: a #GSList list of localized strings;
 										 *       the provider may append messages to this list,
 										 *       but shouldn't reinitialize it. */
 };
diff --git a/src/core/na-export-format.c b/src/core/na-export-format.c
index e2eb774..338be01 100644
--- a/src/core/na-export-format.c
+++ b/src/core/na-export-format.c
@@ -43,10 +43,10 @@ struct NAExportFormatClassPrivate {
 /* private instance data
  */
 struct NAExportFormatPrivate {
-	gboolean       dispose_has_run;
-	GQuark         id;
+	gboolean           dispose_has_run;
+	GQuark             id;
 	NAIExporterFormat *str;
-	NAIExporter   *exporter;
+	NAIExporter       *exporter;
 };
 
 static GObjectClass *st_parent_class = NULL;
@@ -305,3 +305,26 @@ na_export_format_get_description( const NAExportFormat *format )
 
 	return( description );
 }
+
+/**
+ * na_export_format_get_exporter:
+ * @format: this #NAExportFormat object.
+ *
+ * Returns: a pointer to the #NAIExporter which providers this format.
+ */
+NAIExporter *
+na_export_format_get_exporter( const NAExportFormat *format )
+{
+	NAIExporter *exporter;
+
+	g_return_val_if_fail( NA_IS_EXPORT_FORMAT( format ), NULL );
+
+	exporter = NULL;
+
+	if( !format->private->dispose_has_run ){
+
+		exporter = format->private->exporter;
+	}
+
+	return( exporter );
+}
diff --git a/src/core/na-export-format.h b/src/core/na-export-format.h
index d121a1a..756e941 100644
--- a/src/core/na-export-format.h
+++ b/src/core/na-export-format.h
@@ -73,6 +73,7 @@ gchar          *na_export_format_get_id         ( const NAExportFormat *format )
 gchar          *na_export_format_get_ask_label  ( const NAExportFormat *format );
 gchar          *na_export_format_get_label      ( const NAExportFormat *format );
 gchar          *na_export_format_get_description( const NAExportFormat *format );
+NAIExporter    *na_export_format_get_exporter   ( const NAExportFormat *format );
 
 G_END_DECLS
 
diff --git a/src/core/na-exporter.c b/src/core/na-exporter.c
index 8249d44..611171d 100644
--- a/src/core/na-exporter.c
+++ b/src/core/na-exporter.c
@@ -32,7 +32,7 @@
 #include <config.h>
 #endif
 
-#include <api/na-iexporter.h>
+#include <glib/gi18n.h>
 
 #include "na-exporter.h"
 #include "na-export-format.h"
@@ -41,6 +41,8 @@ extern gboolean iexporter_initialized;
 extern gboolean iexporter_finalized;
 
 static const NAIExporterFormat *exporter_get_formats( const NAIExporter *exporter );
+static gchar                   *exporter_get_name( const NAIExporter *exporter );
+static NAIExporter             *find_exporter_for_format( const NAPivot *pivot, GQuark format );
 
 /**
  * na_exporter_get_formats:
@@ -49,6 +51,8 @@ static const NAIExporterFormat *exporter_get_formats( const NAIExporter *exporte
  * Returns: a list of #NAExportFormat objects, each of them addressing an
  * available export format, i.e. a format provided by a module which
  * implement the #NAIExporter interface.
+ *
+ * The returned list should later be na_exporter_free_formats() by the caller.
  */
 GList *
 na_exporter_get_formats( const NAPivot *pivot )
@@ -80,20 +84,6 @@ na_exporter_get_formats( const NAPivot *pivot )
 	return( formats );
 }
 
-static const NAIExporterFormat *
-exporter_get_formats( const NAIExporter *exporter )
-{
-	const NAIExporterFormat *str;
-
-	str = NULL;
-
-	if( NA_IEXPORTER_GET_INTERFACE( exporter )->get_formats ){
-		str = NA_IEXPORTER_GET_INTERFACE( exporter )->get_formats( exporter );
-	}
-
-	return( str );
-}
-
 /**
  * na_exporter_free_formats:
  * @formats: a list of available export formats, as returned by
@@ -110,32 +100,68 @@ na_exporter_free_formats( GList *formats )
 
 /**
  * na_exporter_to_file:
+ * @pivot: the #NAPivot pivot for the running application.
  * @item: a #NAObjectItem-derived object.
- * @uri: the target URI.
+ * @folder: the URI of the target folder.
  * @format: the #GQuark target format.
  * @messages: a pointer to a #GSList list of strings; the provider
  *  may append messages to this list, but shouldn't reinitialize it.
  *
  * Exports the specified @item to the target @uri in the required @format.
  *
- * Returns: the URI of the exportered file, as a newly allocated string which
+ * Returns: the URI of the exported file, as a newly allocated string which
  * should be g_free() by the caller, or %NULL if an error has been detected.
  */
 gchar *
-na_exporter_to_file( const NAObjectItem *item, const gchar *uri, GQuark format, GSList **messages )
+na_exporter_to_file( const NAPivot *pivot, const NAObjectItem *item, const gchar *folder, GQuark format, GSList **messages )
 {
-	gchar *fname;
+	gchar *export_uri;
+	NAIExporterFileParms parms;
+	NAIExporter *exporter;
+	gchar *msg;
+	gchar *name;
 
-	fname = NULL;
+	export_uri = NULL;
 
 	if( iexporter_initialized && !iexporter_finalized ){
+
+		exporter = find_exporter_for_format( pivot, format );
+
+		if( exporter ){
+			parms.version = 1;
+			parms.exported = ( NAObjectItem * ) item;
+			parms.folder = ( gchar * ) folder;
+			parms.format = format;
+			parms.basename = NULL;
+			parms.messages = *messages;
+
+			if( NA_IEXPORTER_GET_INTERFACE( exporter )->to_file ){
+				NA_IEXPORTER_GET_INTERFACE( exporter )->to_file( exporter, &parms );
+
+				if( parms.basename ){
+					export_uri = g_strdup_printf( "%s%s%s", folder, G_DIR_SEPARATOR_S, parms.basename );
+				}
+
+			} else {
+				name = exporter_get_name( exporter );
+				msg = g_strdup_printf( _( "NAIExporter %s doesn't implement 'to_file' interface." ), name );
+				*messages = g_slist_append( *messages, msg );
+				g_free( name );
+			}
+
+		} else {
+			msg = g_strdup_printf(
+					_( "No NAIExporter implementation found for %s format." ), g_quark_to_string( format ));
+			*messages = g_slist_append( *messages, msg );
+		}
 	}
 
-	return( fname );
+	return( export_uri );
 }
 
 /**
  * na_exporter_to_buffer:
+ * @pivot: the #NAPivot pivot for the running application.
  * @item: a #NAObjectItem-derived object.
  * @format: the #GQuark target format.
  * @messages: a pointer to a #GSList list of strings; the provider
@@ -147,14 +173,96 @@ na_exporter_to_file( const NAObjectItem *item, const gchar *uri, GQuark format,
  * be g_free() by the caller, or %NULL if an error has been detected.
  */
 gchar *
-na_exporter_to_buffer( const NAObjectItem *item, GQuark format, GSList **messages )
+na_exporter_to_buffer( const NAPivot *pivot, const NAObjectItem *item, GQuark format, GSList **messages )
 {
 	gchar *buffer;
+	NAIExporterBufferParms parms;
+	NAIExporter *exporter;
+	gchar *name;
+	gchar *msg;
 
 	buffer = NULL;
 
 	if( iexporter_initialized && !iexporter_finalized ){
+
+		exporter = find_exporter_for_format( pivot, format );
+
+		if( exporter ){
+			parms.version = 1;
+			parms.exported = ( NAObjectItem * ) item;
+			parms.format = format;
+			parms.buffer = NULL;
+			parms.messages = *messages;
+
+			if( NA_IEXPORTER_GET_INTERFACE( exporter )->to_buffer ){
+				NA_IEXPORTER_GET_INTERFACE( exporter )->to_buffer( exporter, &parms );
+
+				if( parms.buffer ){
+					buffer = parms.buffer;
+				}
+
+			} else {
+				name = exporter_get_name( exporter );
+				msg = g_strdup_printf( _( "NAIExporter %s doesn't implement 'to_buffer' interface." ), name );
+				*messages = g_slist_append( *messages, msg );
+				g_free( name );
+			}
+
+		} else {
+			msg = g_strdup_printf(
+					_( "No NAIExporter implementation found for %s format." ), g_quark_to_string( format ));
+			*messages = g_slist_append( *messages, msg );
+		}
 	}
 
 	return( buffer );
 }
+
+static const NAIExporterFormat *
+exporter_get_formats( const NAIExporter *exporter )
+{
+	const NAIExporterFormat *str;
+
+	str = NULL;
+
+	if( NA_IEXPORTER_GET_INTERFACE( exporter )->get_formats ){
+		str = NA_IEXPORTER_GET_INTERFACE( exporter )->get_formats( exporter );
+	}
+
+	return( str );
+}
+
+static gchar *
+exporter_get_name( const NAIExporter *exporter )
+{
+	gchar *name;
+
+	name = NULL;
+
+	if( NA_IEXPORTER_GET_INTERFACE( exporter )->get_name ){
+		name = NA_IEXPORTER_GET_INTERFACE( exporter )->get_name( exporter );
+	}
+
+	return( name );
+}
+
+static NAIExporter *
+find_exporter_for_format( const NAPivot *pivot, GQuark format )
+{
+	NAIExporter *exporter;
+	GList *formats, *ifmt;
+
+	exporter = NULL;
+	formats = na_exporter_get_formats( pivot );
+
+	for( ifmt = formats ; ifmt && !exporter ; ifmt = ifmt->next ){
+
+		if( na_export_format_get_quark( NA_EXPORT_FORMAT( ifmt->data )) == format ){
+			exporter = na_export_format_get_exporter( NA_EXPORT_FORMAT( ifmt->data ));
+		}
+	}
+
+	na_exporter_free_formats( formats );
+
+	return( exporter );
+}
diff --git a/src/core/na-exporter.h b/src/core/na-exporter.h
index 5801aeb..2254a18 100644
--- a/src/core/na-exporter.h
+++ b/src/core/na-exporter.h
@@ -37,7 +37,7 @@
  * @include: core/na-exporter.h
  */
 
-#include <api/na-object-item.h>
+#include <api/na-object-api.h>
 
 #include <core/na-pivot.h>
 
@@ -46,8 +46,8 @@ G_BEGIN_DECLS
 GList *na_exporter_get_formats ( const NAPivot *pivot );
 void   na_exporter_free_formats( GList *formats );
 
-gchar *na_exporter_to_file  ( const NAObjectItem *item, const gchar *uri, GQuark format, GSList **messages );
-gchar *na_exporter_to_buffer( const NAObjectItem *item, GQuark format, GSList **messages );
+gchar *na_exporter_to_file  ( const NAPivot *pivot, const NAObjectItem *item, const gchar *uri, GQuark format, GSList **messages );
+gchar *na_exporter_to_buffer( const NAPivot *pivot, const NAObjectItem *item, GQuark format, GSList **messages );
 
 G_END_DECLS
 
diff --git a/src/core/na-iexporter.c b/src/core/na-iexporter.c
index e75bf1e..edf8c3c 100644
--- a/src/core/na-iexporter.c
+++ b/src/core/na-iexporter.c
@@ -43,12 +43,11 @@ struct NAIExporterInterfacePrivate {
 gboolean iexporter_initialized = FALSE;
 gboolean iexporter_finalized   = FALSE;
 
-static GType                register_type( void );
-static void                 interface_base_init( NAIExporterInterface *klass );
-static void                 interface_base_finalize( NAIExporterInterface *klass );
+static GType register_type( void );
+static void  interface_base_init( NAIExporterInterface *klass );
+static void  interface_base_finalize( NAIExporterInterface *klass );
 
-static guint                iexporter_get_version( const NAIExporter *instance );
-static const NAIExporterFormat *iexporter_get_formats( const NAIExporter *instance );
+static guint iexporter_get_version( const NAIExporter *instance );
 
 /**
  * na_iexporter_get_type:
@@ -111,7 +110,8 @@ interface_base_init( NAIExporterInterface *klass )
 		klass->private = g_new0( NAIExporterInterfacePrivate, 1 );
 
 		klass->get_version = iexporter_get_version;
-		klass->get_formats = iexporter_get_formats;
+		klass->get_name = NULL;
+		klass->get_formats = NULL;
 		klass->to_file = NULL;
 		klass->to_buffer = NULL;
 
@@ -139,9 +139,3 @@ iexporter_get_version( const NAIExporter *instance )
 {
 	return( 1 );
 }
-
-static const NAIExporterFormat *
-iexporter_get_formats( const NAIExporter *instance )
-{
-	return( NULL );
-}
diff --git a/src/core/na-importer.c b/src/core/na-importer.c
index 783c77f..44e4dbb 100644
--- a/src/core/na-importer.c
+++ b/src/core/na-importer.c
@@ -70,8 +70,8 @@ na_importer_import_from_uri( const NAPivot *pivot, NAIImporterUriParms *parms )
 
 		for( im = modules ; im && code == IMPORTER_CODE_NOT_WILLING_TO ; im = im->next ){
 
-			if( NA_IIMPORTER_GET_INTERFACE( NA_IIMPORTER( im->data ))->import_from_uri ){
-				code = NA_IIMPORTER_GET_INTERFACE( NA_IIMPORTER( im->data ))->import_from_uri( NA_IIMPORTER( im->data ), parms );
+			if( NA_IIMPORTER_GET_INTERFACE( NA_IIMPORTER( im->data ))->from_uri ){
+				code = NA_IIMPORTER_GET_INTERFACE( NA_IIMPORTER( im->data ))->from_uri( NA_IIMPORTER( im->data ), parms );
 			}
 		}
 
diff --git a/src/io-xml/naxml-provider.c b/src/io-xml/naxml-provider.c
index 2f3dc36..affaa93 100644
--- a/src/io-xml/naxml-provider.c
+++ b/src/io-xml/naxml-provider.c
@@ -94,20 +94,21 @@ static NAIExporterFormat st_formats[] = {
 static GType         st_module_type = 0;
 static GObjectClass *st_parent_class = NULL;
 
-static void                 class_init( NAXMLProviderClass *klass );
-static void                 instance_init( GTypeInstance *instance, gpointer klass );
-static void                 instance_dispose( GObject *object );
-static void                 instance_finalize( GObject *object );
+static void                     class_init( NAXMLProviderClass *klass );
+static void                     instance_init( GTypeInstance *instance, gpointer klass );
+static void                     instance_dispose( GObject *object );
+static void                     instance_finalize( GObject *object );
 
-static void                 iimporter_iface_init( NAIImporterInterface *iface );
-static guint                iimporter_get_version( const NAIImporter *importer );
+static void                     iimporter_iface_init( NAIImporterInterface *iface );
+static guint                    iimporter_get_version( const NAIImporter *importer );
 
-static void                 iexporter_iface_init( NAIExporterInterface *iface );
-static guint                iexporter_get_version( const NAIExporter *exporter );
+static void                     iexporter_iface_init( NAIExporterInterface *iface );
+static guint                    iexporter_get_version( const NAIExporter *exporter );
+static gchar                   *iexporter_get_name( const NAIExporter *exporter );
 static const NAIExporterFormat *iexporter_get_formats( const NAIExporter *exporter );
 
-static void                 ifactory_provider_iface_init( NAIFactoryProviderInterface *iface );
-static guint                ifactory_provider_get_version( const NAIFactoryProvider *factory );
+static void                     ifactory_provider_iface_init( NAIFactoryProviderInterface *iface );
+static guint                    ifactory_provider_get_version( const NAIFactoryProvider *factory );
 
 GType
 naxml_provider_get_type( void )
@@ -256,6 +257,7 @@ iexporter_iface_init( NAIExporterInterface *iface )
 	g_debug( "%s: iface=%p", thisfn, ( void * ) iface );
 
 	iface->get_version = iexporter_get_version;
+	iface->get_name = iexporter_get_name;
 	iface->get_formats = iexporter_get_formats;
 	iface->to_file = NULL;
 	iface->to_buffer = NULL;
@@ -267,6 +269,12 @@ iexporter_get_version( const NAIExporter *exporter )
 	return( 1 );
 }
 
+static gchar *
+iexporter_get_name( const NAIExporter *exporter )
+{
+	return( g_strdup( "NAXML Provider" ));
+}
+
 static const NAIExporterFormat *
 iexporter_get_formats( const NAIExporter *exporter )
 {
diff --git a/src/nact/nact-assistant-export.c b/src/nact/nact-assistant-export.c
index 466b9db..24247b7 100644
--- a/src/nact/nact-assistant-export.c
+++ b/src/nact/nact-assistant-export.c
@@ -708,11 +708,15 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
 	NactAssistantExport *window;
 	GList *actions, *ia;
 	ExportStruct *str;
+	NactApplication *application;
+	NAUpdater *updater;
 
 	g_debug( "%s: window=%p, assistant=%p", thisfn, ( void * ) wnd, ( void * ) assistant );
 	g_assert( NACT_IS_ASSISTANT_EXPORT( wnd ));
 	window = NACT_ASSISTANT_EXPORT( wnd );
 
+	application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
+	updater = nact_application_get_updater( application );
 	actions = nact_iactions_list_bis_get_selected_items( NACT_IACTIONS_LIST( window ));
 
 	g_assert( window->private->uri && strlen( window->private->uri ));
@@ -732,7 +736,7 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
 		}
 
 		if( str->format != IPREFS_EXPORT_NO_EXPORT ){
-			str->fname = na_exporter_to_file( str->item, window->private->uri, str->format, &str->msg );
+			str->fname = na_exporter_to_file( NA_PIVOT( updater ), str->item, window->private->uri, str->format, &str->msg );
 		}
 	}
 
diff --git a/src/nact/nact-clipboard.c b/src/nact/nact-clipboard.c
index 77b689f..9494cfb 100644
--- a/src/nact/nact-clipboard.c
+++ b/src/nact/nact-clipboard.c
@@ -534,6 +534,8 @@ static gchar *
 export_row_object( NactClipboard *clipboard, NAObject *object, const gchar *dest_folder, GList **exported )
 {
 	GList *subitems, *isub;
+	NactApplication *application;
+	NAUpdater *updater;
 	NAObjectAction *action;
 	gint index;
 	GString *data;
@@ -564,6 +566,9 @@ export_row_object( NactClipboard *clipboard, NAObject *object, const gchar *dest
 		action = NA_OBJECT_ACTION( na_object_get_parent( object ));
 	}
 
+	application = NACT_APPLICATION( base_window_get_application( clipboard->private->window ));
+	updater = nact_application_get_updater( application );
+
 	index = g_list_index( *exported, ( gconstpointer ) action );
 	if( index == -1 ){
 
@@ -577,11 +582,11 @@ export_row_object( NactClipboard *clipboard, NAObject *object, const gchar *dest
 		if( format != IPREFS_EXPORT_NO_EXPORT ){
 
 			if( dest_folder ){
-				fname = na_exporter_to_file( NA_OBJECT_ITEM( action), dest_folder, format, &msg );
+				fname = na_exporter_to_file( NA_PIVOT( updater ), NA_OBJECT_ITEM( action), dest_folder, format, &msg );
 				g_free( fname );
 
 			} else {
-				buffer = na_exporter_to_buffer( NA_OBJECT_ITEM( action ), format, NULL );
+				buffer = na_exporter_to_buffer( NA_PIVOT( updater ), NA_OBJECT_ITEM( action ), format, NULL );
 			}
 		}
 	}



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