[nautilus-actions] na_exporter_get_export_format(): new function



commit 1368c9c14e76c73e9a0d2ad96e797685654c5ede
Author: Pierre Wieser <pwieser trychlos org>
Date:   Thu Jan 5 19:19:35 2012 +0100

    na_exporter_get_export_format(): new function
    
    Replaces removed na_iprefs_get_export_format() and na_iprefs_set_export_format() functions.

 ChangeLog                        |   16 ++++++++
 src/core/na-export-format.h      |    4 --
 src/core/na-exporter.c           |   71 ++++++++++++++++++++++++++++++++++----
 src/core/na-exporter.h           |   32 ++++++++++++++---
 src/core/na-iprefs.c             |   41 ----------------------
 src/core/na-iprefs.h             |    3 --
 src/nact/nact-assistant-export.c |   24 +++++++------
 src/nact/nact-clipboard.c        |    7 ++--
 src/nact/nact-export-ask.c       |   50 ++++++++++++++++-----------
 src/nact/nact-export-ask.h       |    7 +++-
 10 files changed, 159 insertions(+), 96 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c604fd4..957e488 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2012-01-05 Pierre Wieser <pwieser trychlos org>
 
+	* src/core/na-export-format.h: Remove IPREFS_EXPORT_ definitions from here.
+
+	* src/core/na-exporter.c:
+	* src/core/na-exporter.h (na_exporter_get_export_format): New function.
+
+	* src/core/na-iprefs.c:
+	* src/core/na-iprefs.h
+	(na_iprefs_get_export_format, na_iprefs_set_export_format): Removed functions.
+
+	* src/nact/nact-assistant-export.c
+	(on_base_initialize_base_window, assist_prepare_confirm, assist_prepare_exportdone):
+	* src/nact/nact-clipboard.c (export_row_object):
+	* src/nact/nact-export-ask.c (nact_export_ask_user, get_export_format):
+	* src/nact/nact-export-ask.h:
+	Updated accordingly.
+	
 	* src/core/na-iprefs.c:
 	* src/core/na-iprefs.h (na_iprefs_set_import_mode): Removed function.
 
diff --git a/src/core/na-export-format.h b/src/core/na-export-format.h
index d1adced..8a22b87 100644
--- a/src/core/na-export-format.h
+++ b/src/core/na-export-format.h
@@ -63,10 +63,6 @@ typedef struct {
 }
 	NAExportFormatClass;
 
-#define IPREFS_EXPORT_FORMAT_ASK_ID		"Ask"
-#define IPREFS_EXPORT_FORMAT_ASK		g_quark_from_static_string( IPREFS_EXPORT_FORMAT_ASK_ID )
-#define IPREFS_EXPORT_NO_EXPORT			1
-
 GType           na_export_format_get_type( void );
 
 NAExportFormat *na_export_format_new( const NAIExporterFormatExt *exporter_format );
diff --git a/src/core/na-exporter.c b/src/core/na-exporter.c
index 677de8e..db394b8 100644
--- a/src/core/na-exporter.c
+++ b/src/core/na-exporter.c
@@ -33,9 +33,14 @@
 #endif
 
 #include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <string.h>
 
 #include "na-exporter.h"
 #include "na-export-format.h"
+#include "na-settings.h"
+
+#define	Ask			"Ask"
 
 typedef struct {
 	const gchar *format;				/* export format saved in user's preferences */
@@ -47,7 +52,7 @@ typedef struct {
 
 static NAExporterFormatStr st_format_ask = {
 
-		"Ask",
+		Ask,
 		N_( "_Ask me" ),
 		N_( "You will be asked for the format to choose each time an item " \
 			"is about to be exported." ),
@@ -59,6 +64,7 @@ static void         exporter_free_formats( const NAIExporter *exporter, GList *
 static gchar       *exporter_get_name( const NAIExporter *exporter );
 static NAIExporter *find_exporter_for_format( const NAPivot *pivot, GQuark format );
 static void         on_pixbuf_finalized( gpointer user_data, GObject *pixbuf );
+static GQuark       id_from_string( const gchar *format_str );
 
 /*
  * na_exporter_get_formats:
@@ -245,7 +251,7 @@ on_pixbuf_finalized( gpointer user_data /* ==NULL */, GObject *pixbuf )
  * na_exporter_to_buffer:
  * @pivot: the #NAPivot pivot for the running application.
  * @item: a #NAObjectItem-derived object.
- * @format: the #GQuark target format.
+ * @format: the target format identifier.
  * @messages: a pointer to a #GSList list of strings; the provider
  *  may append messages to this list, but shouldn't reinitialize it.
  *
@@ -255,7 +261,8 @@ on_pixbuf_finalized( gpointer user_data /* ==NULL */, GObject *pixbuf )
  * be g_free() by the caller, or %NULL if an error has been detected.
  */
 gchar *
-na_exporter_to_buffer( const NAPivot *pivot, const NAObjectItem *item, GQuark format, GSList **messages )
+na_exporter_to_buffer( const NAPivot *pivot,
+		const NAObjectItem *item, GQuark format, GSList **messages )
 {
 	static const gchar *thisfn = "na_exporter_to_buffer";
 	gchar *buffer;
@@ -269,11 +276,11 @@ na_exporter_to_buffer( const NAPivot *pivot, const NAObjectItem *item, GQuark fo
 
 	buffer = NULL;
 
-	g_debug( "%s: pivot=%p, item=%p (%s), format=%u (%s), messages=%p",
+	g_debug( "%s: pivot=%p, item=%p (%s), format=%u, messages=%p",
 			thisfn,
 			( void * ) pivot,
 			( void * ) item, G_OBJECT_TYPE_NAME( item ),
-			( guint ) format, g_quark_to_string( format ),
+			( guint ) format,
 			( void * ) messages );
 
 	exporter = find_exporter_for_format( pivot, format );
@@ -314,7 +321,7 @@ na_exporter_to_buffer( const NAPivot *pivot, const NAObjectItem *item, GQuark fo
  * @pivot: the #NAPivot pivot for the running application.
  * @item: a #NAObjectItem-derived object.
  * @folder_uri: the URI of the target folder.
- * @format: the #GQuark target format.
+ * @format: the target format identifier.
  * @messages: a pointer to a #GSList list of strings; the provider
  *  may append messages to this list, but shouldn't reinitialize it.
  *
@@ -324,7 +331,8 @@ na_exporter_to_buffer( const NAPivot *pivot, const NAObjectItem *item, GQuark fo
  * should be g_free() by the caller, or %NULL if an error has been detected.
  */
 gchar *
-na_exporter_to_file( const NAPivot *pivot, const NAObjectItem *item, const gchar *folder_uri, GQuark format, GSList **messages )
+na_exporter_to_file( const NAPivot *pivot,
+		const NAObjectItem *item, const gchar *folder_uri, GQuark format, GSList **messages )
 {
 	static const gchar *thisfn = "na_exporter_to_file";
 	gchar *export_uri;
@@ -413,3 +421,52 @@ find_exporter_for_format( const NAPivot *pivot, GQuark format )
 
 	return( exporter );
 }
+
+/*
+ * na_exporter_get_export_format:
+ * @pref: the name of the preference to be read.
+ * @mandatory: if not %NULL, a pointer to a boolean which will receive the
+ *  mandatory property.
+ *
+ * Returns: the export format currently set in user's preference..
+ *
+ * The returned integer is either:
+ * - the corresponding enum value in the case of "NoImport" or "Ask";
+ * - the #GQuark of the string for other export formats.
+ */
+GQuark
+na_exporter_get_export_format( const gchar *pref, gboolean *mandatory )
+{
+	gchar *format_str;
+	GQuark format_id;
+
+	g_return_val_if_fail( pref && strlen( pref ), ( GQuark ) EXPORTER_FORMAT_NO_EXPORT );
+
+	format_str = na_settings_get_string( pref, NULL, mandatory );
+	g_return_val_if_fail( format_str && strlen( format_str ), ( GQuark ) EXPORTER_FORMAT_NO_EXPORT );
+
+	format_id = id_from_string( format_str );
+	g_free( format_str );
+
+	return( format_id );
+}
+
+/*
+ * na_exporter_id_from_string:
+ * @format_str: the string which defines the export format in user's preferences.
+ *
+ * Returns: the integer which identifies the export format.
+ *
+ * The returned integer is either:
+ * - the corresponding enum value in the case of "NoImport" or "Ask";
+ * - the #GQuark of the string for other export formats.
+ */
+static GQuark
+id_from_string( const gchar *format_str )
+{
+	if( !strcmp( format_str, Ask )){
+		return(( GQuark ) EXPORTER_FORMAT_ASK );
+	}
+
+	return( g_quark_from_string( format_str ));
+}
diff --git a/src/core/na-exporter.h b/src/core/na-exporter.h
index f17d593..4a5c231 100644
--- a/src/core/na-exporter.h
+++ b/src/core/na-exporter.h
@@ -43,19 +43,41 @@
 
 G_BEGIN_DECLS
 
+/*
+ * NAExporterExportFormat:
+ * @EXPORTER_FORMAT_NO_EXPORT:
+ * @EXPORTER_FORMAT_ASK:
+ *
+ * This enum defines some special export formats, which are typically used
+ * in switch statements. Standard export formats, as provided by I/O providers,
+ * are just #GQuark of their format identifier string.
+ *
+ * When the user chooses to not export an item, this value is not written in
+ * user's preferences.
+ */
 typedef enum {
 	EXPORTER_FORMAT_NO_EXPORT = 1,
 	EXPORTER_FORMAT_ASK,
 }
 	NAExporterExportFormat;
 
-GList     *na_exporter_get_formats   ( const NAPivot *pivot );
-void       na_exporter_free_formats  ( GList *formats );
+GList     *na_exporter_get_formats      ( const NAPivot *pivot );
+void       na_exporter_free_formats     ( GList *formats );
+
+NAIOption *na_exporter_get_ask_option   ( void );
+
+gchar     *na_exporter_to_buffer        ( const NAPivot *pivot,
+                                          const NAObjectItem *item,
+                                          GQuark format,
+                                          GSList **messages );
 
-NAIOption *na_exporter_get_ask_option( void );
+gchar     *na_exporter_to_file          ( const NAPivot *pivot,
+                                          const NAObjectItem *item,
+                                          const gchar *folder_uri,
+                                          GQuark format,
+                                          GSList **messages );
 
-gchar     *na_exporter_to_buffer( const NAPivot *pivot, const NAObjectItem *item, GQuark format, GSList **messages );
-gchar     *na_exporter_to_file  ( const NAPivot *pivot, const NAObjectItem *item, const gchar *folder_uri, GQuark format, GSList **messages );
+GQuark     na_exporter_get_export_format( const gchar *pref, gboolean *mandatory );
 
 G_END_DECLS
 
diff --git a/src/core/na-iprefs.c b/src/core/na-iprefs.c
index 092344a..f595d23 100644
--- a/src/core/na-iprefs.c
+++ b/src/core/na-iprefs.c
@@ -119,47 +119,6 @@ na_iprefs_set_order_mode( guint mode )
 	na_settings_set_string( NA_IPREFS_ITEMS_LIST_ORDER_MODE, order_str );
 }
 
-/**
- * na_iprefs_get_export_format:
- * @name: name of the export format key to be read
- * @mandatory: if not %NULL, a pointer to a boolean which will receive the
- *  mandatory property.
- *
- * Used to default to export as a GConfEntry.
- * Starting with 3.1.0, defaults to Desktop1 (see. core/na-settings.h)
- *
- * Returns: the export format currently set as a #GQuark.
- */
-GQuark
-na_iprefs_get_export_format( const gchar *name, gboolean *mandatory )
-{
-	GQuark export_format;
-	gchar *format_str;
-
-	export_format = g_quark_from_static_string( NA_IPREFS_DEFAULT_EXPORT_FORMAT );
-
-	format_str = na_settings_get_string( name, NULL, mandatory );
-
-	if( format_str ){
-		export_format = g_quark_from_string( format_str );
-		g_free( format_str );
-	}
-
-	return( export_format );
-}
-
-/**
- * na_iprefs_set_export_format:
- * @format: the new value to be written.
- *
- * Writes the preferred export format' to the preference system.
- */
-void
-na_iprefs_set_export_format( const gchar *name, GQuark format )
-{
-	na_settings_set_string( name, g_quark_to_string( format ));
-}
-
 /*
  * na_iprefs_get_io_providers:
  * @pivot: the #NAPivot application object.
diff --git a/src/core/na-iprefs.h b/src/core/na-iprefs.h
index e54f5c8..85cbd13 100644
--- a/src/core/na-iprefs.h
+++ b/src/core/na-iprefs.h
@@ -56,9 +56,6 @@ guint    na_iprefs_get_order_mode         ( gboolean *mandatory );
 guint    na_iprefs_get_order_mode_by_label( const gchar *label );
 void     na_iprefs_set_order_mode         ( guint mode );
 
-GQuark   na_iprefs_get_export_format      ( const gchar *pref, gboolean *mandatory );
-void     na_iprefs_set_export_format      ( const gchar *pref, GQuark format );
-
 GSList  *na_iprefs_get_io_providers       ( void );
 
 gboolean na_iprefs_write_level_zero       ( const GList *items, GSList **messages );
diff --git a/src/nact/nact-assistant-export.c b/src/nact/nact-assistant-export.c
index cb04354..8b3eebd 100644
--- a/src/nact/nact-assistant-export.c
+++ b/src/nact/nact-assistant-export.c
@@ -42,7 +42,6 @@
 #include <core/na-export-format.h>
 #include <core/na-gtk-utils.h>
 #include <core/na-ioptions-list.h>
-#include <core/na-iprefs.h>
 
 #include "nact-application.h"
 #include "nact-main-window.h"
@@ -505,7 +504,7 @@ on_base_initialize_base_window( NactAssistantExport *window, gpointer user_data
 	GtkWidget *page;
 	guint pos;
 	GtkWidget *pane;
-	GQuark format;
+	gchar *format;
 	gboolean mandatory;
 	GtkWidget *tree_view;
 
@@ -534,12 +533,13 @@ on_base_initialize_base_window( NactAssistantExport *window, gpointer user_data
 		 */
 		page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FORMAT_SELECTION );
 		tree_view = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p3-ExportFormatTreeView" );
-		format = na_iprefs_get_export_format( NA_IPREFS_EXPORT_PREFERRED_FORMAT, &mandatory );
+		format = na_settings_get_string( NA_IPREFS_EXPORT_PREFERRED_FORMAT, NULL, &mandatory );
 		na_ioptions_list_set_editable(
 				NA_IOPTIONS_LIST( window ), tree_view,
 				!mandatory && !window->private->preferences_locked );
 		na_ioptions_list_set_default(
-				NA_IOPTIONS_LIST( window ), tree_view, g_quark_to_string( format ));
+				NA_IOPTIONS_LIST( window ), tree_view, format );
+		g_free( format );
 	}
 }
 
@@ -695,6 +695,7 @@ assist_prepare_confirm( NactAssistantExport *window, GtkAssistant *assistant, Gt
 	gchar *label_item;
 	gchar *format_label, *format_label2;
 	gchar *format_description, *format_description2;
+	gchar *format_id;
 	GtkWidget *label;
 	NAIOption *format;
 	GList *it;
@@ -765,7 +766,9 @@ assist_prepare_confirm( NactAssistantExport *window, GtkAssistant *assistant, Gt
 	g_free( format_description );
 	g_free( format_description2 );
 
-	na_iprefs_set_export_format( NA_IPREFS_EXPORT_PREFERRED_FORMAT, na_export_format_get_quark( NA_EXPORT_FORMAT( format )));
+	format_id = na_ioption_get_id( format );
+	na_settings_set_string( NA_IPREFS_EXPORT_PREFERRED_FORMAT, format_id );
+	g_free( format_id );
 
 	gtk_assistant_set_page_complete( assistant, page, TRUE );
 }
@@ -803,18 +806,17 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
 		window->private->results = g_list_append( window->private->results, str );
 
 		str->item = NA_OBJECT_ITEM( na_object_get_origin( NA_IDUPLICABLE( ia->data )));
+		str->format = na_exporter_get_export_format( NA_IPREFS_EXPORT_PREFERRED_FORMAT, NULL );
 
-		str->format = na_iprefs_get_export_format( NA_IPREFS_EXPORT_PREFERRED_FORMAT, NULL );
-
-		if( str->format == IPREFS_EXPORT_FORMAT_ASK ){
+		if( str->format == EXPORTER_FORMAT_ASK ){
 			str->format = nact_export_ask_user( BASE_WINDOW( wnd ), str->item, first );
 
-			if( str->format == IPREFS_EXPORT_NO_EXPORT ){
+			if( str->format == EXPORTER_FORMAT_NO_EXPORT ){
 				str->msg = g_slist_append( NULL, g_strdup( _( "Export canceled due to user action." )));
 			}
 		}
 
-		if( str->format != IPREFS_EXPORT_NO_EXPORT ){
+		if( str->format != EXPORTER_FORMAT_NO_EXPORT ){
 			str->fname = na_exporter_to_file( NA_PIVOT( updater ), str->item, window->private->uri, str->format, &str->msg );
 		}
 
@@ -889,7 +891,7 @@ assist_prepare_exportdone( NactAssistantExport *window, GtkAssistant *assistant,
 			/* i18n: action as been successfully exported to <filename> */
 			text = g_strdup_printf( "%s %s", _( "Successfully exported as" ), str->fname );
 
-		} else if( str->format != IPREFS_EXPORT_NO_EXPORT ){
+		} else if( str->format != EXPORTER_FORMAT_NO_EXPORT ){
 			errors += 1;
 		}
 
diff --git a/src/nact/nact-clipboard.c b/src/nact/nact-clipboard.c
index 2f87e69..e5e481a 100644
--- a/src/nact/nact-clipboard.c
+++ b/src/nact/nact-clipboard.c
@@ -39,7 +39,6 @@
 
 #include <core/na-exporter.h>
 #include <core/na-export-format.h>
-#include <core/na-iprefs.h>
 
 #include "nact-application.h"
 #include "nact-export-ask.h"
@@ -594,13 +593,13 @@ export_row_object( NactClipboard *clipboard, NAObject *object, const gchar *dest
 	if( index == -1 ){
 
 		*exported = g_list_prepend( *exported, ( gpointer ) action );
-		format = na_iprefs_get_export_format( NA_IPREFS_EXPORT_PREFERRED_FORMAT, NULL );
+		format = na_exporter_get_export_format( NA_IPREFS_EXPORT_PREFERRED_FORMAT, NULL );
 
-		if( format == IPREFS_EXPORT_FORMAT_ASK ){
+		if( format == EXPORTER_FORMAT_ASK ){
 			format = nact_export_ask_user( clipboard->private->window, NA_OBJECT_ITEM( action ), first );
 		}
 
-		if( format != IPREFS_EXPORT_NO_EXPORT ){
+		if( format != EXPORTER_FORMAT_NO_EXPORT ){
 			if( dest_folder ){
 				fname = na_exporter_to_file( NA_PIVOT( updater ), NA_OBJECT_ITEM( action), dest_folder, format, &msgs );
 				g_free( fname );
diff --git a/src/nact/nact-export-ask.c b/src/nact/nact-export-ask.c
index c30b838..9a299b4 100644
--- a/src/nact/nact-export-ask.c
+++ b/src/nact/nact-export-ask.c
@@ -43,7 +43,6 @@
 #include <core/na-iprefs.h>
 
 #include "nact-application.h"
-#include "nact-export-format.h"
 #include "nact-export-ask.h"
 #include "base-gtk-utils.h"
 
@@ -199,11 +198,17 @@ instance_init( GTypeInstance *instance, gpointer klass )
 
 	self->private = g_new0( NactExportAskPrivate, 1 );
 
-	base_window_signal_connect( BASE_WINDOW( instance ),
-			G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk_toplevel ));
+	base_window_signal_connect(
+			BASE_WINDOW( instance ),
+			G_OBJECT( instance ),
+			BASE_SIGNAL_INITIALIZE_GTK,
+			G_CALLBACK( on_base_initialize_gtk_toplevel ));
 
-	base_window_signal_connect( BASE_WINDOW( instance ),
-			G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_base_window ));
+	base_window_signal_connect(
+			BASE_WINDOW( instance ),
+			G_OBJECT( instance ),
+			BASE_SIGNAL_INITIALIZE_WINDOW,
+			G_CALLBACK( on_base_initialize_base_window ));
 
 	self->private->dispose_has_run = FALSE;
 }
@@ -279,15 +284,14 @@ nact_export_ask_user( BaseWindow *parent, NAObjectItem *item, gboolean first )
 	gboolean are_locked, mandatory;
 	gboolean keep, keep_mandatory;
 	int code;
+	GQuark format;
 
-	GQuark format = g_quark_from_static_string( NA_IPREFS_DEFAULT_EXPORT_FORMAT );
-
-	g_return_val_if_fail( BASE_IS_WINDOW( parent ), format );
+	g_return_val_if_fail( BASE_IS_WINDOW( parent ), EXPORTER_FORMAT_NO_EXPORT );
 
 	g_debug( "%s: parent=%p, item=%p (%s), first=%s",
 			thisfn, ( void * ) parent, ( void * ) item, G_OBJECT_TYPE_NAME( item ), first ? "True":"False" );
 
-	format = na_iprefs_get_export_format( NA_IPREFS_EXPORT_ASK_USER_LAST_FORMAT, &mandatory );
+	format = na_exporter_get_export_format( NA_IPREFS_EXPORT_ASK_USER_LAST_FORMAT, &mandatory );
 	keep = na_settings_get_boolean( NA_IPREFS_EXPORT_ASK_USER_KEEP_LAST_CHOICE, NULL, &keep_mandatory );
 
 	if( first || !keep ){
@@ -318,7 +322,7 @@ nact_export_ask_user( BaseWindow *parent, NAObjectItem *item, gboolean first )
 			case GTK_RESPONSE_CANCEL:
 			/* base_dialog::do_run only returns OK or CANCEL */
 			default:
-				format = IPREFS_EXPORT_NO_EXPORT;
+				format = EXPORTER_FORMAT_NO_EXPORT;
 				break;
 		}
 
@@ -388,11 +392,17 @@ on_base_initialize_base_window( NactExportAsk *editor )
 				editor->private->keep_last_choice,
 				!editor->private->keep_last_choice_mandatory, !editor->private->preferences_locked );
 
-		base_window_signal_connect_by_name( BASE_WINDOW( editor ),
-				"CancelButton", "clicked", G_CALLBACK( on_cancel_clicked ));
-
-		base_window_signal_connect_by_name( BASE_WINDOW( editor ),
-				"OKButton", "clicked", G_CALLBACK( on_ok_clicked ));
+		base_window_signal_connect_by_name(
+				BASE_WINDOW( editor ),
+				"CancelButton",
+				"clicked",
+				G_CALLBACK( on_cancel_clicked ));
+
+		base_window_signal_connect_by_name(
+				BASE_WINDOW( editor ),
+				"OKButton",
+				"clicked",
+				G_CALLBACK( on_ok_clicked ));
 	}
 }
 
@@ -442,19 +452,19 @@ get_export_format( NactExportAsk *editor )
 {
 	GtkWidget *widget;
 	NAIOption *format;
-	GQuark format_quark;
+	gchar *format_id;
 
 	widget = base_window_get_widget( BASE_WINDOW( editor ), "ExportFormatAskVBox" );
 	format = na_ioptions_list_get_selected( NA_IOPTIONS_LIST( editor ), widget );
 	g_return_val_if_fail( NA_IS_EXPORT_FORMAT( format ), 0 );
 
-	format_quark = na_export_format_get_quark( NA_EXPORT_FORMAT( format ));
-
 	if( !editor->private->keep_last_choice_mandatory ){
 		na_settings_set_boolean( NA_IPREFS_EXPORT_ASK_USER_KEEP_LAST_CHOICE, editor->private->keep_last_choice );
 	}
 
-	na_iprefs_set_export_format( NA_IPREFS_EXPORT_ASK_USER_LAST_FORMAT, format_quark );
+	format_id = na_ioption_get_id( format );
+	na_settings_set_string( NA_IPREFS_EXPORT_ASK_USER_LAST_FORMAT, format_id );
+	g_free( format_id );
 
-	return( format_quark );
+	return( na_export_format_get_quark( NA_EXPORT_FORMAT( format )));
 }
diff --git a/src/nact/nact-export-ask.h b/src/nact/nact-export-ask.h
index 7c03ab7..f209c82 100644
--- a/src/nact/nact-export-ask.h
+++ b/src/nact/nact-export-ask.h
@@ -38,7 +38,12 @@
  *
  * This class is derived from BaseDialog.
  * It is ran each time an action is to be exported, and the user want
- * to be ask to choose the export format.
+ * to be asked to choose the export format.
+ *
+ * Only actually available export formats, as provided by i/o providers,
+ * are proposed here:
+ * - the 'Ask' option is obviously not proposed here
+ * - a 'NoImport' capability is provided by clicking on Cancel button.
  */
 
 #include <api/na-object-item.h>



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