From 3bdd43a4682a12cd27da03a6d4b3b4d948f9c808 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Sun, 29 Dec 2013 22:39:07 +0300 Subject: [PATCH] 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); -- 1.8.3.2