aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-02-15 11:12:32 -0600
committerTed Gould <ted@gould.cx>2012-02-15 11:12:32 -0600
commit90aa71ca8b1ef10d2dfad3b5f18212fc50d0c088 (patch)
tree42c2aca26c68a92a40aad2240fabef2d18b6447c /libdbusmenu-gtk
parent4e11380a712fe09471e105b605e1f1bb285b09f9 (diff)
parent031394edac21d148926e65051149f8dc71f98b68 (diff)
downloadlibdbusmenu-90aa71ca8b1ef10d2dfad3b5f18212fc50d0c088.tar.gz
libdbusmenu-90aa71ca8b1ef10d2dfad3b5f18212fc50d0c088.tar.bz2
libdbusmenu-90aa71ca8b1ef10d2dfad3b5f18212fc50d0c088.zip
Fix some of the issues with throwing criticals
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/client.c7
-rw-r--r--libdbusmenu-gtk/parser.c9
2 files changed, 8 insertions, 8 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index 30ded29..830356a 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -1152,12 +1152,7 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, GVariant
return;
}
- const gchar * value = NULL;
- if (variant != NULL) {
- value = g_variant_get_string(variant, NULL);
- }
-
- if (value == NULL || value[0] == '\0') {
+ if (variant == NULL) {
/* This means that we're unsetting a value. */
/* Try to use the other one */
if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_NAME)) {
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index aefbd05..ab3b77a 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -427,8 +427,11 @@ parse_menu_structure_helper (GtkWidget * widget, RecurseContext * recurse)
/* Oops, let's tell our parents about us */
if (peek == NULL) {
- if (dbusmenu_menuitem_get_parent(thisitem) != NULL) {
- dbusmenu_menuitem_unparent(thisitem);
+ g_object_ref(thisitem);
+
+ DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent(thisitem);
+ if (parent != NULL) {
+ dbusmenu_menuitem_child_delete(parent, thisitem);
}
gint pos = get_child_position (widget);
@@ -439,6 +442,8 @@ parse_menu_structure_helper (GtkWidget * widget, RecurseContext * recurse)
else
dbusmenu_menuitem_child_append (recurse->parent,
thisitem);
+
+ g_object_unref(thisitem);
}
}