Bug 2784 - user <Exclude>s show up in "Other"
Summary: user <Exclude>s show up in "Other"
Status: RESOLVED FIXED
Alias: None
Product: PyXDG
Classification: Unclassified
Component: PyXDG (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Heinrich Wendel
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-21 23:46 UTC by Travis Watkins
Modified: 2005-03-21 21:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
small patch (493 bytes, patch)
2005-03-22 04:06 UTC, Travis Watkins
Details | Splinter Review
small patch (421 bytes, patch)
2005-03-22 04:33 UTC, Travis Watkins
Details | Splinter Review
Corrected patch. (412 bytes, patch)
2005-03-22 05:01 UTC, Michael K. Edwards
Details | Splinter Review
actually works (701 bytes, patch)
2005-03-22 05:02 UTC, Travis Watkins
Details | Splinter Review

Description Travis Watkins 2005-03-21 23:46:27 UTC
When I set an <Exclude> in my ~/.config/menus/applications.menu file they get
removed from GNOME's menu layout (like I'm pretty sure they should be). But
PyXDG places them in the "Other" category. I believe this has to do with
__genmenuOnlyAllocated() running on the full merged menu file while it should
run on the merged file first then again on the rest of the user's menu file.
Here is my applications.menu, in case it helps:

<!DOCTYPE Menu PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
'http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd'>
<Menu>
  <Name>Applications</Name>
  <MergeFile>/etc/xdg/menus/applications.menu</MergeFile>
  <Menu>
    <Name>Internet</Name>
      <Exclude>
        <Filename>gnome-btdownload.desktop</Filename>
      </Exclude>
  </Menu>
</Menu>

The gnome-btdownload entry ends up in "Other" using PyXDG and is removed as it
should be in the GNOME menus.
Comment 1 Travis Watkins 2005-03-22 04:06:58 UTC
Created attachment 2179 [details] [review]
small patch
Comment 2 Travis Watkins 2005-03-22 04:08:46 UTC
(In reply to comment #1)
> Created an attachment (id=2179) [edit]
> small patch
> 

This patch makes <Exclude>ed entries that were included earlier stay allocated
as the spec says.
Comment 3 Travis Watkins 2005-03-22 04:33:50 UTC
Created attachment 2180 [details] [review]
small patch

If a previous <Include> pattern matched the menu entry, then it sets entry.Add
to True.  So the correct behavior for <Exclude>, if it finds entry.Add to be
True, is to set it to False but to remember that it was allocated along the
way.
Comment 4 Michael K. Edwards 2005-03-22 05:01:42 UTC
Created attachment 2181 [details] [review]
Corrected patch.

A menu entry that is matched by an <Exclude> rule, and was previously matched
by an <Include> rule for the same menu, should not be added but should be put
into Allocated state immediately so that <Unallocated> won't match it.
Comment 5 Travis Watkins 2005-03-22 05:02:16 UTC
Created attachment 2182 [details] [review]
actually works

bitten by tabs vs spaces in one of those, this one solves that issue
Comment 6 Michael K. Edwards 2005-03-22 06:15:25 UTC
"Actually works" patch is backwards and has irrelevant whitespace changes.  I
recommend "Corrected patch."  :)
Comment 7 Heinrich Wendel 2005-03-22 09:25:49 UTC
already fixed in cvs 
Comment 8 Heinrich Wendel 2005-03-22 16:06:30 UTC
and released as pyxdg-0.9 


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.