From 51815a2cd05dd18d649113f2fc76247d7fdf00d1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Jun 2010 09:36:57 -0500 Subject: Eh, that's not a rat hole that I want to go down. Realized I'd have to build the types with their vtables to go that way. We'll try using the others. --- libdbusmenu-gtk/menuitem.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'libdbusmenu-gtk/menuitem.c') diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c index 9154592..8874ebe 100644 --- a/libdbusmenu-gtk/menuitem.c +++ b/libdbusmenu-gtk/menuitem.c @@ -275,27 +275,6 @@ dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, c return dbusmenu_menuitem_property_set_shortcut(menuitem, key->accel_key, key->accel_mods); } -static const gchar * wrapper_type_name = "wrapper-type"; -static const gchar * string_array_type_name = "string-array-type"; - -static GType wrapper_type = 0; -static GType string_array_type = 0; - -/* Works with dbus to get types for the collections that we're using. - Should be pretty quick if we've done this once already. */ -static void -setup_collections (void) { - if (string_array_type == 0) { - dbus_g_type_get_collection(string_array_type_name, G_TYPE_STRING); - } - - if (wrapper_type == 0) { - dbus_g_type_get_collection(wrapper_type_name, string_array_type); - } - - return; -} - /** dbusmenu_menuitem_property_get_shortcut: @menuitem: The #DbusmenuMenuitem to get the shortcut off @@ -312,13 +291,12 @@ dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * ke *modifier = 0; g_return_if_fail(DBUSMENU_IS_MENUITEM(menuitem)); - setup_collections(); const GValue * wrapper = dbusmenu_menuitem_property_get_value(menuitem, DBUSMENU_MENUITEM_PROP_SHORTCUT); if (wrapper == NULL) { return; } - if (!G_VALUE_HOLDS(wrapper, wrapper_type)) { + if (!G_VALUE_HOLDS(wrapper, G_TYPE_BOXED)) { g_warning("Unexpected shortcut structure. Wrapper is: %s", G_VALUE_TYPE_NAME(wrapper)); return; } @@ -333,7 +311,7 @@ dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * ke } GValue * ventryarray = g_ptr_array_index(wrapperarray, 0); - if (!G_VALUE_HOLDS(ventryarray, string_array_type)) { + if (!G_VALUE_HOLDS(ventryarray, G_TYPE_BOXED)) { g_warning("Unexpected shortcut structure. Value array is: %s", G_VALUE_TYPE_NAME(ventryarray)); return; } -- cgit v1.2.3