ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #03201
[Branch ~dbusmenu-team/dbusmenu/trunk] Rev 236: Changing the property changed handler to get the property instead of using accessor functions tha...
Merge authors:
Mathieu Trudel-Lapierre (mathieu-tl)
Related merge proposals:
https://code.launchpad.net/~mathieu-tl/dbusmenu/widget_notify_properties_access/+merge/50974
proposed by: Mathieu Trudel-Lapierre (mathieu-tl)
review: Approve - Ted Gould (ted)
------------------------------------------------------------
revno: 236 [merge]
committer: Ted Gould <ted@xxxxxxxx>
branch nick: trunk
timestamp: Thu 2011-02-24 11:23:47 -0600
message:
Changing the property changed handler to get the property instead of using accessor functions that might not be the same
modified:
libdbusmenu-gtk/parser.c
--
lp:dbusmenu
https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk
Your team ayatana-commits is subscribed to branch lp:dbusmenu.
To unsubscribe from this branch go to https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk/+edit-subscription
=== modified file 'libdbusmenu-gtk/parser.c'
--- libdbusmenu-gtk/parser.c 2011-02-24 16:33:40 +0000
+++ libdbusmenu-gtk/parser.c 2011-02-24 17:23:47 +0000
@@ -753,30 +753,34 @@
gpointer data)
{
DbusmenuMenuitem *child = (DbusmenuMenuitem *)data;
+ GValue prop_value = {0};
+
+ g_value_init (&prop_value, pspec->value_type);
+ g_object_get_property (G_OBJECT (widget), pspec->name, &prop_value);
if (pspec->name == g_intern_static_string ("sensitive"))
{
dbusmenu_menuitem_property_set_bool (child,
DBUSMENU_MENUITEM_PROP_ENABLED,
- gtk_widget_get_sensitive (widget));
+ g_value_get_boolean (&prop_value));
}
else if (pspec->name == g_intern_static_string ("label"))
{
dbusmenu_menuitem_property_set (child,
DBUSMENU_MENUITEM_PROP_LABEL,
- gtk_menu_item_get_label (GTK_MENU_ITEM (widget)));
+ g_value_get_string (&prop_value));
}
else if (pspec->name == g_intern_static_string ("visible"))
{
dbusmenu_menuitem_property_set_bool (child,
DBUSMENU_MENUITEM_PROP_VISIBLE,
- gtk_widget_get_visible (widget));
+ g_value_get_boolean (&prop_value));
}
else if (pspec->name == g_intern_static_string ("image") ||
pspec->name == g_intern_static_string ("always-show-image"))
{
GtkWidget *image;
- image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (widget));
+ image = GTK_WIDGET (g_value_get_object (&prop_value));
update_icon (child, GTK_IMAGE (image));
}
else if (pspec->name == g_intern_static_string ("parent"))
@@ -785,7 +789,7 @@
* We probably should have added a 'remove' method to the
* UbuntuMenuProxy early on, but it's late in the cycle now.
*/
- if (gtk_widget_get_parent (widget) == NULL)
+ if (GTK_WIDGET (g_value_get_object (&prop_value)) == NULL)
{
g_signal_handlers_disconnect_by_func (widget,
G_CALLBACK (widget_notify_cb),
@@ -821,7 +825,7 @@
recurse.parent = item;
if (item != NULL) {
- GtkWidget * menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
+ GtkWidget * menu = GTK_WIDGET (g_value_get_object (&prop_value));
parse_menu_structure_helper(menu, &recurse);
} else {
/* Note: it would be really odd that we wouldn't have a cached
@@ -830,6 +834,7 @@
g_object_unref(G_OBJECT(recurse.parent));
}
}
+ g_value_unset (&prop_value);
}
/* A child item was added to a menu we're watching. Let's try to integrate it. */