menu-spec: Excluded items are Unllocated

Mark McLoughlin markmc at redhat.com
Fri Feb 18 18:09:00 EET 2005


Hi Waldo,
	Sorry it took so long to get to this - I had to fix our test program
first :-)

On Thu, 2005-02-03 at 22:48 +0100, Waldo Bastian wrote:
> On Friday 10 December 2004 16:50, Mark McLoughlin wrote:
> > Hi,
> >
> > On Wed, 2004-12-08 at 09:40 -0500, Mark McLoughlin wrote:
> > > On Wed, 2004-12-08 at 14:55 +0100, Waldo Bastian wrote:
> > > > On Wednesday 08 December 2004 14:32, you wrote:
> > > > > 	Well, we could say that items which match an <Include> rule are
> > > > > "allocated" whether or not they are later excluded by an <Exclude>
> > > > > rule. If the goal of <OnlyUnAllocated/> is to catch items that don't
> > > > > fit in any other category, then I think that would work fine.
> > > >
> > > > Hmm... so
> > > >
> > > > <Include>
> > > >  <And><Category>foo</Category><Not><Category>bar</Category></Not></And>
> > > > </Include>
> > > >
> > > > would not allocate the "bar" items and
> > > >
> > > > <Include>
> > > >  <And><Category>foo</Category></And>
> > > > </Include>
> > > > <Exclude>
> > > >  <And><Category>bar</Category></And>
> > > > </Exclude>
> > > >
> > > > would allocate the "bar" items then?
> > > >
> > > > I guess that would work.
> > >
> > > 	Right, the idea being that in former example items with Category Bar
> > > aren't a good fit for that menu, but in the latter example they are a
> > > good fit, but you just don't want them displayed.
> > >
> > > 	How does the attached patch look? Also changed the <OnlyUnallocated>
> > > test to catch this.
> >
> > 	I've gone ahead and committed that now ...
> 
> Ok, I have adjusted the KDE menu to take this change into account but I am 
> still left with a failed regression test "m".
> 
> The problem is basically that KDE considers menu entries that are allocated to 
> a menu that is hidden as allocated, while the test case doesn't consider them 
> to be allocated.
> 
> So the test-case puts kwrite, kedit and kate in the "Other" menu, while KDE 
> puts them in the "Hidden" menu.
> 
> I don't think that hiding a menu should influence the allocation.

	Okay, I agree and it seems that's what the GNOME implementation is
doing anyway.

	One problem though - your results show the "Hidden" menu, but it
shouldn't be displayed at all because the .directory file has
NoDisplay=true. I think that was the real purpose behind the "m" test
case.

> The next question is, how should the result look like when the menu was 
> <Deleted/> instead of hidden. I have added testcase "n" for that for now. I 
> think that also in this case kwrite, kedit and kate should not appear in the 
> "Other" menu.

	Yep, so the output from both "m" and "n" should be:

 Other/ freecell.desktop        /tmp/menutestdir/xdg_data_dir/applications/freecell.desktop

	I just went ahead and committed ...

Thanks,
Mark.




More information about the xdg mailing list