Menu-Spec and nested AppDirs / Still not solved

Heinrich Wendel h_wendel at cojobo.net
Sat Nov 5 03:48:34 PST 2005


Hi,

For those who didn't read my previous mails, here the problem again:

Ok, I try to collect proposed solutions and add just another problem. Here the 
test-case again:

While writing a MenuEditor component for pyxdg I ran into the following 
problem. Take the following menu file:

<Menu>
  <Name>Applications</Name>
  <DefaultAppDirs/>
  <DefaultDirectoryDirs/>
  <Menu>
    <Name>Editors</Name>
    <Include>
      <Category>Editors</Category>
    </Include>
  </Menu>
  <Menu>
    <Name>Debian</Name>
    <AppDir>/usr/share/debian/applications</AppDir>
    <Menu>
      <Name>Games</Name>
      <Include>
        <Category>Games</Category>
      </Include>
  </Menu>
</Menu>

This works fine as long as you don't try to edit things.

1.) try to edit an entry in the "Games" menu, but what happens? You can't edit 
it because /usr/share/debian/applications will have a higher priority than 
the users settings.

2.) try to move an entry in the "Games" menu by excluding it in the debian 
menu and includnig it in the "Editors" menu, but what happens? It won't work, 
because the "Editors" menu can't find the item, because it don't 
has /usr/share/debian/applications in it's AppDir's.

3.) try to move the whole "Games" menu to a toplevel menu, but what happens? 
It will be empty, because it don't has /usr/sharedebian/applications in it's 
AppDir's.

Now my proposed solution:

I think the problem is the <Move> element. It was inteded for menu editing, 
still it makes menu editing very difficult. I think that is because the 
<Move> elements are handled at the merging step, which is wrong in my 
opinion. This can cause a lot of confusing, see examples above. A better 
solution would be to handle them after the menu is generated, this would 
eliminate problem  3. Additionally it should be possible to also move 
desktopfileids with the <Move> Element, this would fix problem 2. And to fix 
problem 1 directories in the users home folder should always have preference 
over systemwide folders.
In my opinion this are only small changes, since those features are currently 
rarely used and thus changing them could only benefit us. 

mfg, heinrich :-)



More information about the xdg mailing list