From 27decf6ab777452167198f37a3e491a34b1d5556 Mon Sep 17 00:00:00 2001
From: Benedikt Meurer <benny@xfce.org>
Date: Fri, 25 Nov 2005 23:48:02 +0000
Subject: [PATCH] 2005-11-26	Benedikt Meurer <benny@xfce.org>

	* thunar/thunar-standard-view.c
	  (thunar_standard_view_merge_custom_actions): Don't sort custom actions
	  explicitly, but leave it up to the provider plugins to determine the
	  order of their actions. Also, be sure to update the UI manager after
	  unmerging the previously set menu actions, else GtkUIManager will
	  mess up the order of the actions.




(Old svn revision: 18938)
---
 ChangeLog                     |  9 +++++++++
 thunar/thunar-standard-view.c | 13 +------------
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5d8e4deed..41f858d89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-11-26	Benedikt Meurer <benny@xfce.org>
+
+	* thunar/thunar-standard-view.c
+	  (thunar_standard_view_merge_custom_actions): Don't sort custom actions
+	  explicitly, but leave it up to the provider plugins to determine the
+	  order of their actions. Also, be sure to update the UI manager after
+	  unmerging the previously set menu actions, else GtkUIManager will
+	  mess up the order of the actions.
+
 2005-11-25	Benedikt Meurer <benny@xfce.org>
 
 	* thunarx/thunarx-provider-factory.c: Make sure, ThunarxProviderModules
diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index 77b9c3082..c9431d36a 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -1149,15 +1149,6 @@ thunar_standard_view_get_selected_paths (ThunarStandardView *standard_view)
 
 
 
-static gint
-compare_actions (gconstpointer a,
-                 gconstpointer b)
-{
-  return strcmp (gtk_action_get_name (GTK_ACTION (a)), gtk_action_get_name (GTK_ACTION (b)));
-}
-
-
-
 static void
 thunar_standard_view_merge_custom_actions (ThunarStandardView *standard_view,
                                            GList              *selected_items)
@@ -1246,6 +1237,7 @@ thunar_standard_view_merge_custom_actions (ThunarStandardView *standard_view,
   if (G_LIKELY (standard_view->priv->custom_actions != 0))
     {
       gtk_ui_manager_remove_ui (standard_view->ui_manager, standard_view->priv->custom_merge_id);
+      gtk_ui_manager_ensure_update (standard_view->ui_manager);
       standard_view->priv->custom_merge_id = 0;
     }
 
@@ -1265,9 +1257,6 @@ thunar_standard_view_merge_custom_actions (ThunarStandardView *standard_view,
       standard_view->priv->custom_merge_id = gtk_ui_manager_new_merge_id (standard_view->ui_manager);
       gtk_ui_manager_insert_action_group (standard_view->ui_manager, standard_view->priv->custom_actions, -1);
 
-      /* sort the actions by their names */
-      actions = g_list_sort (actions, compare_actions);
-
       /* add the actions to the UI manager */
       for (lp = actions; lp != NULL; lp = lp->next)
         {
-- 
GitLab