After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 168526 - [PATCH] No way to get excluded menu items
[PATCH] No way to get excluded menu items
Status: RESOLVED FIXED
Product: gnome-menus
Classification: Core
Component: libgnome-menu
git master
Other All
: High normal
: ---
Assigned To: gnome-menus dummy account
gnome-menus dummy account
Depends on:
Blocks:
 
 
Reported: 2005-02-25 17:42 UTC by Christian Neumair
Modified: 2005-04-07 08:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch. (6.55 KB, patch)
2005-02-25 17:43 UTC, Christian Neumair
none Details | Review
Proposed patch #2 (9.01 KB, patch)
2005-03-24 14:54 UTC, Christian Neumair
none Details | Review
Slight addition for adding submenus that are not shown to excluded contents (597 bytes, patch)
2005-03-24 23:26 UTC, Christian Neumair
none Details | Review
Proposed patch (8.72 KB, patch)
2005-04-04 18:10 UTC, Christian Neumair
none Details | Review

Description Christian Neumair 2005-02-25 17:42:47 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.
Comment 1 Christian Neumair 2005-02-25 17:43:58 UTC
Created attachment 37939 [details] [review]
Proposed patch.
Comment 2 Christian Neumair 2005-03-24 14:54:44 UTC
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?
Comment 3 Christian Neumair 2005-03-24 15:27:56 UTC
s^put it^put excluded menu items^
Comment 4 Christian Neumair 2005-03-24 23:11:36 UTC
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?
Comment 5 Christian Neumair 2005-03-24 23:26:10 UTC
Created attachment 39226 [details] [review]
Slight addition for adding submenus that are not shown to excluded contents
Comment 6 Christian Neumair 2005-03-24 23:50:43 UTC
Hrm the last addition has weird side effects. Looks like I'll have to dive
deeper into the code.
Comment 7 Christian Neumair 2005-03-25 00:08:52 UTC
The last addition works correctly. It was gnome-menu-editor which was broken.
Sorry for the confusion.
Comment 8 Christian Neumair 2005-03-29 23:18:44 UTC
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.
Comment 9 Christian Neumair 2005-04-04 18:10:02 UTC
Created attachment 39679 [details] [review]
Proposed patch

Updated against HEAD. Mark: Any comments?
Comment 10 Mark McLoughlin 2005-04-06 21:36:08 UTC
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 ?
Comment 11 Christian Neumair 2005-04-06 21:40:52 UTC
Yup, it should :).
Comment 12 Christian Neumair 2005-04-06 21:56:33 UTC
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
  • #0 desktop_entry_get_no_display
    at desktop-entries.c line 499
  • #1 process_layout
    at menu-tree.c line 3134
  • #15 process_layout
    at menu-tree.c line 3134

Comment 13 Mark McLoughlin 2005-04-07 07:57:09 UTC
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.
Comment 14 Mark McLoughlin 2005-04-07 08:18:14 UTC
Oh, and try a pristine checkout from CVS too