diff --git a/thunar/thunar-dnd.c b/thunar/thunar-dnd.c index 663156df3f2c449a08bd7bb8cfd83b0f31496e92..e263a6e0bf1e7c8797d8b27d8dcdfea7d4e744fa 100644 --- a/thunar/thunar-dnd.c +++ b/thunar/thunar-dnd.c @@ -155,7 +155,7 @@ thunar_dnd_ask (GtkWidget *widget, /* add menu items for all items */ for (lp = items; lp != NULL; lp = lp->next) { - action = thunar_util_action_from_menu_item (G_OBJECT (lp->data), window); + action = thunar_util_action_from_menu_item (G_OBJECT (lp->data)); /* add a menu item for the action */ item = gtk_action_create_menu_item (action); diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c index 063122159b931f04255647a10211b5f3beb8a675..fd6bdc3cb2c87b007b157774ff340d2db63b467c 100644 --- a/thunar/thunar-icon-factory.c +++ b/thunar/thunar-icon-factory.c @@ -79,8 +79,7 @@ static GdkPixbuf *thunar_icon_factory_load_from_file (ThunarIconFactory static GdkPixbuf *thunar_icon_factory_lookup_icon (ThunarIconFactory *factory, const gchar *name, gint size, - gboolean wants_default, - gboolean force_size); + gboolean wants_default); static guint thunar_icon_key_hash (gconstpointer data); static gboolean thunar_icon_key_equal (gconstpointer a, gconstpointer b); @@ -469,8 +468,7 @@ static GdkPixbuf* thunar_icon_factory_lookup_icon (ThunarIconFactory *factory, const gchar *name, gint size, - gboolean wants_default, - gboolean force_size) + gboolean wants_default) { ThunarIconKey lookup_key; ThunarIconKey *key; @@ -501,8 +499,7 @@ thunar_icon_factory_lookup_icon (ThunarIconFactory *factory, name = "folder"; /* check if the icon theme contains an icon of that name */ - icon_info = gtk_icon_theme_lookup_icon (factory->icon_theme, name, size, - force_size ? GTK_ICON_LOOKUP_FORCE_SIZE : 0); + icon_info = gtk_icon_theme_lookup_icon (factory->icon_theme, name, size, GTK_ICON_LOOKUP_FORCE_SIZE); if (G_LIKELY (icon_info != NULL)) { /* try to load the pixbuf from the icon info */ @@ -606,7 +603,7 @@ static GdkPixbuf* thunar_icon_factory_load_fallback (ThunarIconFactory *factory, gint size) { - return thunar_icon_factory_lookup_icon (factory, "text-x-generic", size, FALSE, TRUE); + return thunar_icon_factory_lookup_icon (factory, "text-x-generic", size, FALSE); } @@ -752,8 +749,7 @@ GdkPixbuf* thunar_icon_factory_load_icon (ThunarIconFactory *factory, const gchar *name, gint size, - gboolean wants_default, - gboolean force_size) + gboolean wants_default) { _thunar_return_val_if_fail (THUNAR_IS_ICON_FACTORY (factory), NULL); _thunar_return_val_if_fail (size > 0, NULL); @@ -771,7 +767,7 @@ thunar_icon_factory_load_icon (ThunarIconFactory *factory, } /* lookup the icon */ - return thunar_icon_factory_lookup_icon (factory, name, size, wants_default, force_size); + return thunar_icon_factory_lookup_icon (factory, name, size, wants_default); } @@ -823,7 +819,7 @@ thunar_icon_factory_load_file_icon (ThunarIconFactory *factory, if (custom_icon != NULL) { /* try to load the icon */ - icon = thunar_icon_factory_lookup_icon (factory, custom_icon, icon_size, FALSE, TRUE); + icon = thunar_icon_factory_lookup_icon (factory, custom_icon, icon_size, FALSE); if (G_LIKELY (icon != NULL)) return icon; } @@ -897,7 +893,7 @@ thunar_icon_factory_load_file_icon (ThunarIconFactory *factory, if (G_LIKELY (icon == NULL)) { icon_name = thunar_file_get_icon_name (file, icon_state, factory->icon_theme); - icon = thunar_icon_factory_load_icon (factory, icon_name, icon_size, TRUE, TRUE); + icon = thunar_icon_factory_load_icon (factory, icon_name, icon_size, TRUE); } if (G_LIKELY (icon != NULL)) diff --git a/thunar/thunar-icon-factory.h b/thunar/thunar-icon-factory.h index cf29a7177af031471fbb189561025505d082e6df..a7137ab561e9fbd57439b7e12d945339f18d1511 100644 --- a/thunar/thunar-icon-factory.h +++ b/thunar/thunar-icon-factory.h @@ -54,8 +54,7 @@ gboolean thunar_icon_factory_get_show_thumbnail (const ThunarIconF GdkPixbuf *thunar_icon_factory_load_icon (ThunarIconFactory *factory, const gchar *name, gint size, - gboolean wants_default, - gboolean force_size); + gboolean wants_default); GdkPixbuf *thunar_icon_factory_load_file_icon (ThunarIconFactory *factory, ThunarFile *file, diff --git a/thunar/thunar-icon-renderer.c b/thunar/thunar-icon-renderer.c index fe411708b046e23ea7ac7f05ed3f46e9d057a364..1561dc719a31a52d85769f0f1b34cdb40a8e4e90 100644 --- a/thunar/thunar-icon-renderer.c +++ b/thunar/thunar-icon-renderer.c @@ -497,7 +497,7 @@ thunar_icon_renderer_render (GtkCellRenderer *renderer, emblem_size = MIN ((2 * icon_renderer->size) / 3, 32); /* check if we have the emblem in the icon theme */ - emblem = thunar_icon_factory_load_icon (icon_factory, lp->data, emblem_size, FALSE, TRUE); + emblem = thunar_icon_factory_load_icon (icon_factory, lp->data, emblem_size, FALSE); if (G_UNLIKELY (emblem == NULL)) continue; diff --git a/thunar/thunar-renamer-dialog.c b/thunar/thunar-renamer-dialog.c index 39da1a4cec2acb1096e0d4dd4975f2bb4e6c625b..08716bb368efdd0a47fea26d0b87eaf08aea6f4b 100644 --- a/thunar/thunar-renamer-dialog.c +++ b/thunar/thunar-renamer-dialog.c @@ -877,7 +877,7 @@ thunar_renamer_dialog_context_menu (ThunarRenamerDialog *renamer_dialog, /* add the items to the UI manager */ for (lp = items; lp != NULL; lp = lp->next) { - action = thunar_util_action_from_menu_item (G_OBJECT (lp->data), GTK_WIDGET (renamer_dialog)); + action = thunar_util_action_from_menu_item (G_OBJECT (lp->data)); /* add the action to the action group */ gtk_action_group_add_action (renamer_actions, action); diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c index 06b5e6f9e7651651c6211e2c195bb4f3bcb24853..0685246a51e2adf4ffd6c0a16b9b959909634825 100644 --- a/thunar/thunar-shortcuts-view.c +++ b/thunar/thunar-shortcuts-view.c @@ -1244,7 +1244,7 @@ thunar_shortcuts_view_context_menu (ThunarShortcutsView *view, /* add the menu items to the menu */ for (lp = items; lp != NULL; lp = lp->next) { - action = thunar_util_action_from_menu_item (G_OBJECT (lp->data), window); + action = thunar_util_action_from_menu_item (G_OBJECT (lp->data)); item = gtk_action_create_menu_item (action); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 4cfe3e4d995b74cedda6cced71a2d92a9270d1a1..165507be427c34c475bbbcfd120ba1ee820e77c5 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -2078,7 +2078,7 @@ thunar_standard_view_merge_custom_actions (ThunarStandardView *standard_view, /* add the menu items to the UI manager */ for (lp = items; lp != NULL; lp = lp->next) { - action = thunar_util_action_from_menu_item (G_OBJECT (lp->data), window); + action = thunar_util_action_from_menu_item (G_OBJECT (lp->data)); /* add the action to the action group */ gtk_action_group_add_action (standard_view->priv->custom_actions, action); diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index 4856356a4435e8d579c7877a5726b8edb7f8006f..b5a6533e2904b5da7186124398ca008f6b8bcf97 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -1518,7 +1518,7 @@ thunar_tree_view_context_menu (ThunarTreeView *view, /* add the menu items to the menu */ for (lp = items; lp != NULL; lp = lp->next) { - action = thunar_util_action_from_menu_item (G_OBJECT (lp->data), window); + action = thunar_util_action_from_menu_item (G_OBJECT (lp->data)); item = gtk_action_create_menu_item (action); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); diff --git a/thunar/thunar-util.c b/thunar/thunar-util.c index c769dbcb2600862095fe3c285c0c4f6075a698aa..0784e5c18aba74a8d27dbea8362be932b81b7ccd 100644 --- a/thunar/thunar-util.c +++ b/thunar/thunar-util.c @@ -54,9 +54,9 @@ #include <glib/gwin32.h> #endif -#include <thunar/thunar-icon-factory.h> #include <thunar/thunar-private.h> #include <thunar/thunar-util.h> +#include <thunarx/thunarx.h> #include <glib.h> #include <glib/gstdio.h> @@ -623,15 +623,11 @@ extension_action_callback (GtkAction *action, GtkAction * -thunar_util_action_from_menu_item (GObject *item, - GtkWidget *parent_widget) +thunar_util_action_from_menu_item (GObject *item) { gchar *name, *label, *tooltip, *icon_name; - gboolean sensitive, priority; - GtkAction *action; - GdkPixbuf *icon; - GtkIconTheme *icon_theme; - ThunarIconFactory *icon_factory; + gboolean sensitive, priority; + GtkAction *action; g_return_val_if_fail (THUNARX_IS_MENU_ITEM (item), NULL); @@ -646,18 +642,9 @@ thunar_util_action_from_menu_item (GObject *item, action = gtk_action_new (name, label, tooltip, NULL); - if (icon_name != NULL && parent_widget != NULL) + if (icon_name != NULL) { - icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (parent_widget)); - icon_factory = thunar_icon_factory_get_for_icon_theme (icon_theme); - icon = thunar_icon_factory_load_icon (icon_factory, icon_name, GTK_ICON_SIZE_MENU, TRUE, FALSE); - if (icon != NULL) - { - gtk_action_set_gicon (action, G_ICON (icon)); - g_object_unref (icon); - } - - g_object_unref (G_OBJECT (icon_factory)); + gtk_action_set_icon_name (action, icon_name); } gtk_action_set_sensitive (action, sensitive); diff --git a/thunar/thunar-util.h b/thunar/thunar-util.h index 68220d6fb3224bd33a642e9464e745531a2cdd85..eee56bed9d4596f27d2e5d98b0ee10f7aeea260c 100644 --- a/thunar/thunar-util.h +++ b/thunar/thunar-util.h @@ -55,8 +55,7 @@ gchar *thunar_util_change_working_directory (const gchar *new_directory) void thunar_setup_display_cb (gpointer data); -GtkAction *thunar_util_action_from_menu_item (GObject *item, - GtkWidget *parent_widget) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; +GtkAction *thunar_util_action_from_menu_item (GObject *item) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; G_END_DECLS; diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 34b6af3c772c6f0709bd2fce866dd78d3a107043..462ecebd64f1f2d2cfb0970948ffaf45a10f4056 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -1967,7 +1967,7 @@ thunar_window_merge_custom_preferences (ThunarWindow *window) for (ap = items; ap != NULL; ap = ap->next) { /* add the action to the action group */ - action = thunar_util_action_from_menu_item (G_OBJECT (ap->data), GTK_WIDGET (window)); + action = thunar_util_action_from_menu_item (G_OBJECT (ap->data)); gtk_action_group_add_action (window->action_group, action); /* add the action to the UI manager */ @@ -3441,7 +3441,7 @@ thunar_window_update_custom_actions (ThunarView *view, if (G_UNLIKELY (lp->data == NULL)) continue; - action = thunar_util_action_from_menu_item (G_OBJECT (lp->data), GTK_WIDGET (window)); + action = thunar_util_action_from_menu_item (G_OBJECT (lp->data)); /* add the action to the action group */ gtk_action_group_add_action_with_accel (window->custom_actions,