GNOME Bugzilla – Bug 168526
[PATCH] No way to get excluded menu items
Last modified: 2005-04-07 08:18:14 UTC
Currently, there is no way to get all menu items in a menu affected by the <Exclude> directive. I've attached a patch to fix this. Pretty important for menu editing.
Created attachment 37939 [details] [review] Proposed patch.
Created attachment 39200 [details] [review] Proposed patch #2 Mark: Do you like how getting excluded items is handled in this patch? IMHO, excluded entries could be interesting for gnome-panel as well (maybe there are plans to resurrect basic menu editing and put it into a "More..." entry); doesn't KDE have something like this?
s^put it^put excluded menu items^
On a sidenote: Maybe one should also be able to list menus that don't appear in the tree because they are empty and <Layout show_empty="true"/> isn't set. Does it sound reasonable to model these hidden menus into this data structure as well?
Created attachment 39226 [details] [review] Slight addition for adding submenus that are not shown to excluded contents
Hrm the last addition has weird side effects. Looks like I'll have to dive deeper into the code.
The last addition works correctly. It was gnome-menu-editor which was broken. Sorry for the confusion.
For clarification: The (now obsoleted) first patch is against gnome-menus < 2.11.1 (stable branch). Patches 2 and 3 are meant to be applied against HEAD, which contains <Layout> handling/get_contents API changes.
Created attachment 39679 [details] [review] Proposed patch Updated against HEAD. Mark: Any comments?
Okay, I've committed the following to HEAD: 1) add a "flags" argument to menu_tree_lookup () with two interesting flags currently - "include excluded" and "show empty" 2) add menu_tree_entry_get_is_excluded () I think that should work for you, right ?
Yup, it should :).
I'm trying to make gnome-menu-editor HEAD use this modifications, but while trying to run menu_tree_get_root_directory on a menu_tree_lookup'ed tree, I get a segfault, no matter what flags I pass (run with MENU_TREE_FLAGS_NONE): 1283 root = menu_tree_get_root_directory (*tree); (gdb) n (gnome-menu-editor:14939): libgnomevfs-CRITICAL **: gnome_vfs_get_uri_from_local_path: assertion `local_full_path[0] == '/'' failed (gnome-menu-editor:14939): libgnomevfs-CRITICAL **: gnome_vfs_uri_new_private: assertion `text_uri != NULL' failed Program received signal SIGSEGV, Segmentation fault. desktop_entry_get_no_display (entry=0x1ea64) at desktop-entries.c:499 499 return (entry->flags & DESKTOP_ENTRY_NO_DISPLAY) != 0; (gdb) bt
+ Trace 57809
I can't reproduce anything like this - please open a new bug with more details, e.g. full stack trace, MENU_VERBOSE=1 output and .menu files involved.
Oh, and try a pristine checkout from CVS too