[Xfce4-commits] <thunar:master> Use some new API for actions.
Nick Schermer
noreply at xfce.org
Thu Oct 25 19:36:01 CEST 2012
Updating branch refs/heads/master
to 220949afa8d9f819c047a9b536bf9efb49f3bfb6 (commit)
from 876d761681f4c27fa2143f878fbb5211b257b0cc (commit)
commit 220949afa8d9f819c047a9b536bf9efb49f3bfb6
Author: Nick Schermer <nick at xfce.org>
Date: Thu Oct 25 19:23:29 2012 +0200
Use some new API for actions.
thunar/thunar-gtk-extensions.c | 2 +-
thunar/thunar-window.c | 11 +++++------
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/thunar/thunar-gtk-extensions.c b/thunar/thunar-gtk-extensions.c
index 42c8f0e..6b2a2c4 100644
--- a/thunar/thunar-gtk-extensions.c
+++ b/thunar/thunar-gtk-extensions.c
@@ -57,7 +57,7 @@ thunar_gtk_action_set_tooltip (GtkAction *action,
va_end (var_args);
/* setup the tooltip for the action */
- g_object_set (G_OBJECT (action), "tooltip", tooltip, NULL);
+ gtk_action_set_tooltip (action, tooltip);
/* release the tooltip */
g_free (tooltip);
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index e39ef7b..fa718fd 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -2701,25 +2701,24 @@ static void
thunar_window_menu_item_selected (GtkWidget *menu_item,
ThunarWindow *window)
{
- GtkAction *action;
- gchar *tooltip;
- gint id;
+ GtkAction *action;
+ const gchar *tooltip;
+ gint id;
/* we can only display tooltips if we have a statusbar */
if (G_LIKELY (window->statusbar != NULL))
{
/* determine the action for the menu item */
- action = g_object_get_data (G_OBJECT (menu_item), I_("gtk-action"));
+ action = gtk_widget_get_action (menu_item);
if (G_UNLIKELY (action == NULL))
return;
/* determine the tooltip from the action */
- g_object_get (G_OBJECT (action), "tooltip", &tooltip, NULL);
+ tooltip = gtk_action_get_tooltip (action);
if (G_LIKELY (tooltip != NULL))
{
id = gtk_statusbar_get_context_id (GTK_STATUSBAR (window->statusbar), "Menu tooltip");
gtk_statusbar_push (GTK_STATUSBAR (window->statusbar), id, tooltip);
- g_free (tooltip);
}
}
}
More information about the Xfce4-commits
mailing list