[nautilus-actions] Keep the same order than Nautilus. Fix #638272



commit fac57f60a4314349e7d5bbca6b8ad6ecab9e4676
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Dec 29 16:38:47 2010 +0100

    Keep the same order than Nautilus. Fix #638272

 ChangeLog            |    3 +++
 src/core/na-tokens.c |   25 ++++++++++++++++++-------
 2 files changed, 21 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bfdca66..7d47e1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-12-29 Pierre Wieser <pwieser trychlos org>
 
+	* src/core/na-tokens.c (build_string_lists):
+	Keep the same order than Nautilus. Fix #638272.
+
 	* src/core/na-selected-info.c (new_from_nautilus_file_info):
 	* src/plugin-menu/nautilus-actions.c (menu_provider_get_file_items):
 	Add debug messages to trace order and names in the selection.
diff --git a/src/core/na-tokens.c b/src/core/na-tokens.c
index 7c2c3f5..a58c7c0 100644
--- a/src/core/na-tokens.c
+++ b/src/core/na-tokens.c
@@ -85,6 +85,7 @@ static void      instance_dispose( GObject *object );
 static void      instance_finalize( GObject *object );
 
 static NATokens *build_string_lists( NATokens *tokens );
+static gchar    *build_string_lists_item( GSList **pslist );
 static void      execute_action_command( const gchar *command, const NAObjectProfile *profile );
 static gboolean  is_singular_exec( const NATokens *tokens, const gchar *exec );
 static gchar    *parse_singular( const NATokens *tokens, const gchar *input, guint i, gboolean utf8 );
@@ -423,17 +424,27 @@ na_tokens_execute_action( const NATokens *tokens, const NAObjectProfile *profile
 static NATokens *
 build_string_lists( NATokens *tokens )
 {
-	tokens->private->uris_str = na_core_utils_slist_join_at_end( tokens->private->uris, " " );
-	tokens->private->filenames_str = na_core_utils_slist_join_at_end( tokens->private->filenames, " " );
-	tokens->private->basedirs_str = na_core_utils_slist_join_at_end( tokens->private->basedirs, " " );
-	tokens->private->basenames_str = na_core_utils_slist_join_at_end( tokens->private->basenames, " " );
-	tokens->private->basenames_woext_str = na_core_utils_slist_join_at_end( tokens->private->basenames_woext, " " );
-	tokens->private->exts_str = na_core_utils_slist_join_at_end( tokens->private->exts, " " );
-	tokens->private->mimetypes_str = na_core_utils_slist_join_at_end( tokens->private->mimetypes, " " );
+	tokens->private->uris_str            = build_string_lists_item( &tokens->private->uris );
+	tokens->private->filenames_str       = build_string_lists_item( &tokens->private->filenames );
+	tokens->private->basedirs_str        = build_string_lists_item( &tokens->private->basedirs );
+	tokens->private->basenames_str       = build_string_lists_item( &tokens->private->basenames );
+	tokens->private->basenames_woext_str = build_string_lists_item( &tokens->private->basenames_woext );
+	tokens->private->exts_str            = build_string_lists_item( &tokens->private->exts );
+	tokens->private->mimetypes_str       = build_string_lists_item( &tokens->private->mimetypes );
 
 	return( tokens );
 }
 
+static gchar *
+build_string_lists_item( GSList **pslist )
+{
+	*pslist = g_slist_reverse( *pslist );
+
+	gchar *str = na_core_utils_slist_join_at_end( *pslist, " " );
+
+	return( str );
+}
+
 static void
 execute_action_command( const gchar *command, const NAObjectProfile *profile )
 {



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