~chrisccoulson/libdbusmenu/lp722972-part-2

« back to all changes in this revision

Viewing changes to libdbusmenu-gtk/parser.c

  • Committer: Ted Gould
  • Date: 2011-03-09 14:30:12 UTC
  • mfrom: (256.2.1 set-cached-menuitem)
  • Revision ID: ted@gould.cx-20110309143012-vn3mofrzxjj95hso
Setting the cache and allowing reparenting of items

Show diffs side-by-side

added added

removed removed

Lines of Context:
219
219
 
220
220
        pdata->widget = widget;
221
221
        g_object_add_weak_pointer(G_OBJECT (widget), (gpointer*)&pdata->widget);
 
222
        g_object_set_data(G_OBJECT(widget), CACHED_MENUITEM, item);
222
223
 
223
224
        return item;
224
225
}
311
312
 
312
313
                        /* Oops, let's tell our parents about us */
313
314
                        if (peek == NULL) {
 
315
                                if (dbusmenu_menuitem_get_parent(thisitem) != NULL) {
 
316
                                        dbusmenu_menuitem_unparent(thisitem);
 
317
                                }
 
318
 
314
319
                                gint pos = get_child_position (widget);
315
320
                                if (pos >= 0)
316
321
                                        dbusmenu_menuitem_child_add_position (recurse->parent,