diff options
author | Ted Gould <ted@gould.cx> | 2011-03-29 09:56:35 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-29 09:56:35 -0500 |
commit | 3d5e747ea498f289f0f98474d628b9f18df3946c (patch) | |
tree | 247418b3b0e4015585b6a13dcc2e642ad9e27812 | |
parent | e89388723962f7cdc6da15369da3af5c83e75c5b (diff) | |
parent | 6c9761c9c66a51d6a00a59f14048267beb7ca7f1 (diff) | |
download | libdbusmenu-3d5e747ea498f289f0f98474d628b9f18df3946c.tar.gz libdbusmenu-3d5e747ea498f289f0f98474d628b9f18df3946c.tar.bz2 libdbusmenu-3d5e747ea498f289f0f98474d628b9f18df3946c.zip |
* Upstream Merge
* Protections and keeping the child variant for the
iterator around longer.
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | libdbusmenu-glib/defaults.c | 2 | ||||
-rw-r--r-- | libdbusmenu-gtk/menuitem.c | 20 |
3 files changed, 25 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index cebdbaf..ff40f6a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libdbusmenu (0.4.0-0ubuntu2~ppa4) UNRELEASED; urgency=low + + * Upstream Merge + * Protections and keeping the child variant for the + iterator around longer. + + -- Ted Gould <ted@ubuntu.com> Tue, 29 Mar 2011 09:56:04 -0500 + libdbusmenu (0.4.0-0ubuntu2~ppa3) natty; urgency=low * Upstream Merge diff --git a/libdbusmenu-glib/defaults.c b/libdbusmenu-glib/defaults.c index 9eaf9e5..ec70da6 100644 --- a/libdbusmenu-glib/defaults.c +++ b/libdbusmenu-glib/defaults.c @@ -85,7 +85,7 @@ dbusmenu_defaults_init (DbusmenuDefaults *self) dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ICON_NAME, G_VARIANT_TYPE_STRING, NULL); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, G_VARIANT_TYPE_STRING, NULL); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, G_VARIANT_TYPE_INT32, NULL); - dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE_ARRAY, NULL); + dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE("aas"), NULL); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, G_VARIANT_TYPE_STRING, NULL); /* Separator defaults */ diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c index f02e171..0f511bc 100644 --- a/libdbusmenu-gtk/menuitem.c +++ b/libdbusmenu-gtk/menuitem.c @@ -275,6 +275,17 @@ dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, c void dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifier) { + guint dummykey; + GdkModifierType dummymodifier; + + if (key == NULL) { + key = &dummykey; + } + + if (modifier == NULL) { + modifier = &dummymodifier; + } + *key = 0; *modifier = 0; @@ -291,10 +302,11 @@ dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * ke } GVariantIter iter; - g_variant_iter_init(&iter, g_variant_get_child_value(wrapper, 0)); + GVariant * child = g_variant_get_child_value(wrapper, 0); + g_variant_iter_init(&iter, child); gchar * string; - while(g_variant_iter_next(&iter, "s", &string)) { + while(g_variant_iter_loop(&iter, "s", &string)) { if (g_strcmp0(string, DBUSMENU_MENUITEM_SHORTCUT_CONTROL) == 0) { *modifier |= GDK_CONTROL_MASK; } else if (g_strcmp0(string, DBUSMENU_MENUITEM_SHORTCUT_ALT) == 0) { @@ -307,10 +319,10 @@ dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * ke GdkModifierType tempmod; gtk_accelerator_parse(string, key, &tempmod); } - - g_free(string); } + g_variant_unref(child); + return; } |