aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/menuitem.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-06-23 09:36:57 -0500
committerTed Gould <ted@gould.cx>2010-06-23 09:36:57 -0500
commit51815a2cd05dd18d649113f2fc76247d7fdf00d1 (patch)
tree479847c766ba6f04b9c875484da14594f67a2c2d /libdbusmenu-gtk/menuitem.c
parent63fc1985fdf9ef74830ec27d7ad8c1bb03c54f0c (diff)
downloadlibdbusmenu-51815a2cd05dd18d649113f2fc76247d7fdf00d1.tar.gz
libdbusmenu-51815a2cd05dd18d649113f2fc76247d7fdf00d1.tar.bz2
libdbusmenu-51815a2cd05dd18d649113f2fc76247d7fdf00d1.zip
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.
Diffstat (limited to 'libdbusmenu-gtk/menuitem.c')
-rw-r--r--libdbusmenu-gtk/menuitem.c26
1 files changed, 2 insertions, 24 deletions
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;
}