diff options
author | Ted Gould <ted@gould.cx> | 2010-07-20 13:24:22 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-07-20 13:24:22 -0500 |
commit | 42f883725a882b1391e79d96efbdcead50dae98c (patch) | |
tree | 800d53ec12770afa0efe7cf3b097566ca9357b14 /libdbusmenu-glib | |
parent | 871df0f10c49d538d80a405c1420bddf8baff79b (diff) | |
download | libdbusmenu-42f883725a882b1391e79d96efbdcead50dae98c.tar.gz libdbusmenu-42f883725a882b1391e79d96efbdcead50dae98c.tar.bz2 libdbusmenu-42f883725a882b1391e79d96efbdcead50dae98c.zip |
Pulling out the update code into it's own function as well.
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index baa3e93..257ad3f 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1068,6 +1068,15 @@ parse_layout_new_child (gint id, DbusmenuClient * client, DbusmenuMenuitem * par return item; } +/* Refresh the properties on this item */ +static void +parse_layout_update (DbusmenuMenuitem * item, DbusmenuClient * client) +{ + g_object_ref(item); + get_properties_globber(client, dbusmenu_menuitem_get_id(item), NULL, menuitem_get_properties_replace_cb, item); + return; +} + /* Parse recursively through the XML and make it into objects as need be */ static DbusmenuMenuitem * @@ -1092,11 +1101,7 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it /* Build a new item */ item = parse_layout_new_child(id, client, parent); } else { - /* Refresh the properties */ - /* XXX: We shouldn't need to get the properties everytime we reuse an entry */ - gchar * properties[1] = {NULL}; /* This gets them all */ - g_object_ref(item); - get_properties_globber(client, id, (const gchar **)properties, menuitem_get_properties_replace_cb, item); + parse_layout_update(item, client); } xmlNodePtr children; |