menu spec include/exclue rules question
hp at redhat.com
Tue Jul 1 23:46:57 EEST 2003
On Tue, Jul 01, 2003 at 10:19:25PM +0200, Heinrich Wendel wrote:
> Is this rule the same as "if (category = 'Games' and category = 'Utilities')
> ..." ?
<Category> is a has-a query rather than an '=' query but yes.
"if (has category Games and has category Utilities)"
> Is this rule the same as "if not (category = 'Games' and category =
> 'Utilities') ..." ?
No, in more detail:
The <Not> element contains a list of matching
rules. If any of the matching rules inside the
<Not> element matches a desktop entry, then the
entire <Not> rule does <emphasis>not</emphasis>
match the desktop entry. That is, matching rules below
<Not> have a logical OR relationship.
So that is "if not (has category Games or has category Utilities)"
Basically any list of predicates is interpreted as OR, it's also
discussed in the definition of <Include>. The exception obviously is
<And>. The <Or> element is thus redundant and useless for the most
part, though it may make sense as a way to do "parentheses" inside
another rule list. i.e.:
So there the "or" is like extra parens in "(Foo and (Bar or Baz))"
<Or> may also contribute to readability in some cases and keep people
from asking why there isn't an <Or>.
More information about the xdg