[Xfce4-commits] <xfdesktop:master> Only use thunarx_menu_provider_get_file_actions (Bug 10492)

Eric Koegel noreply at xfce.org
Wed Jan 1 07:40:01 CET 2014


Updating branch refs/heads/master
         to b13d47e52d3755f9e9c424339063370a8ca7234b (commit)
       from ff207e4a68c3308083c3fc8dab48700672d9f061 (commit)

commit b13d47e52d3755f9e9c424339063370a8ca7234b
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sun Dec 29 22:39:07 2013 +0300

    Only use thunarx_menu_provider_get_file_actions (Bug 10492)
    
    Using thunarx_menu_provider_get_file_actions on both folders and
    files allows all the options to display. Using both files_actions
    and folder_actions would cause some duplicate entires. This allows
    the thunar-archive-plugin to provide the 'create archive' menu
    option for folders on the desktop.

 src/xfdesktop-file-icon-manager.c |   26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
index b263c01..1b424d9 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -1620,24 +1620,16 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
             GList *menu_actions = NULL;
             ThunarxMenuProvider *provider;
 
-            if(g_file_info_get_file_type(info) == G_FILE_TYPE_DIRECTORY) {
-                for(l = fmanager->priv->thunarx_menu_providers; l; l = l->next) {
-                    provider = THUNARX_MENU_PROVIDER(l->data);
-                    menu_actions = g_list_concat(menu_actions,
-                                                 thunarx_menu_provider_get_folder_actions(provider,
-                                                                                          toplevel,
-                                                                                          THUNARX_FILE_INFO(file_icon)));
-                }
-            } else {
-                for(l = fmanager->priv->thunarx_menu_providers; l; l = l->next) {
-                    provider = THUNARX_MENU_PROVIDER(l->data);
-                    menu_actions = g_list_concat(menu_actions,
-                                                 thunarx_menu_provider_get_file_actions(provider,
-                                                                                        toplevel,
-                                                                                        selected));
-                }
+            /* thunar file specific actions (allows them to operate on folders
+             * as well) */
+            for(l = fmanager->priv->thunarx_menu_providers; l; l = l->next) {
+                provider = THUNARX_MENU_PROVIDER(l->data);
+                menu_actions = g_list_concat(menu_actions,
+                                             thunarx_menu_provider_get_file_actions(provider,
+                                                                                    toplevel,
+                                                                                    selected));
             }
-            
+
             if(menu_actions) {
                 xfdesktop_menu_shell_append_action_list(GTK_MENU_SHELL(menu),
                                                         menu_actions);


More information about the Xfce4-commits mailing list