From e4ac9938d306d8a2b581f91367c79018b4718dfb Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 29 Apr 2005 16:31:49 +0000 Subject: [PATCH] Use g_object_notify() instead of triggering a ::notify by re-setting the 2005-04-29 Matthias Clasen * gtk/gtkuimanager.c (update_node): Use g_object_notify() instead of triggering a ::notify by re-setting the property. (#300982, Sven Neumann) * gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip(). --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkaction.c | 14 ++++++++------ gtk/gtkuimanager.c | 5 +---- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index b00a5d9414..435b1a51e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-04-29 Matthias Clasen + * gtk/gtkuimanager.c (update_node): Use g_object_notify() instead + of triggering a ::notify by re-setting the property. (#300982, + Sven Neumann) + + * gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip(). + * gtk/gtkiconview.c (gtk_icon_view_scroll_to_item): Also scroll horizontally when necessary, and keep the northwest corner of the item visible. (#300913, Mathias Hasselmann) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b00a5d9414..435b1a51e4 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,11 @@ 2005-04-29 Matthias Clasen + * gtk/gtkuimanager.c (update_node): Use g_object_notify() instead + of triggering a ::notify by re-setting the property. (#300982, + Sven Neumann) + + * gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip(). + * gtk/gtkiconview.c (gtk_icon_view_scroll_to_item): Also scroll horizontally when necessary, and keep the northwest corner of the item visible. (#300913, Mathias Hasselmann) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b00a5d9414..435b1a51e4 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,11 @@ 2005-04-29 Matthias Clasen + * gtk/gtkuimanager.c (update_node): Use g_object_notify() instead + of triggering a ::notify by re-setting the property. (#300982, + Sven Neumann) + + * gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip(). + * gtk/gtkiconview.c (gtk_icon_view_scroll_to_item): Also scroll horizontally when necessary, and keep the northwest corner of the item visible. (#300913, Mathias Hasselmann) diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c index a664f6e972..51bfa2c38f 100644 --- a/gtk/gtkaction.c +++ b/gtk/gtkaction.c @@ -889,6 +889,8 @@ connect_proxy (GtkAction *action, } else if (GTK_IS_TOOL_ITEM (proxy)) { + GParamSpec *pspec; + /* toolbar item specific synchronisers ... */ g_object_set (proxy, @@ -896,9 +898,11 @@ connect_proxy (GtkAction *action, "visible_vertical", action->private_data->visible_vertical, "is_important", action->private_data->is_important, NULL); - /* FIXME: we should set the tooltip here, but the current api - * doesn't allow it before the item is added to a toolbar. - */ + + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (action), + "tooltip"); + gtk_action_sync_tooltip (action, pspec, proxy); + g_signal_connect_object (action, "notify::visible-horizontal", G_CALLBACK (gtk_action_sync_property), proxy, 0); @@ -926,9 +930,7 @@ connect_proxy (GtkAction *action, "use_underline", TRUE, "stock_id", action->private_data->stock_id, NULL); - /* FIXME: we should set the tooltip here, but the current api - * doesn't allow it before the item is added to a toolbar. - */ + g_signal_connect_object (action, "notify::short-label", G_CALLBACK (gtk_action_sync_short_label), proxy, 0); diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c index e3407e3c2a..d5e759c59d 100644 --- a/gtk/gtkuimanager.c +++ b/gtk/gtkuimanager.c @@ -2070,7 +2070,6 @@ update_node (GtkUIManager *self, Node *info; GNode *child; GtkAction *action; - gchar *tooltip; const gchar *action_name; NodeUIReference *ref; @@ -2455,9 +2454,7 @@ update_node (GtkUIManager *self, * tooltips on toolitems can't be set before the toolitem * is added to the toolbar. */ - g_object_get (action, "tooltip", &tooltip, NULL); - g_object_set (action, "tooltip", tooltip, NULL); - g_free (tooltip); + g_object_notify (G_OBJECT (action), "tooltip"); } } else