This forum has been archived. All content is frozen. Please use KDE Discuss instead.

menu xml file

Tags: None
(comma "," separated)
kalle1950
Registered Member
Posts
16
Karma
0

menu xml file

Fri Jan 22, 2010 1:44 pm
Hello,

hope there is someone out who can help to verify a simple xml file... I just want to be sure that there is everything alright with the file.

The file should be according to http://standards.freedesktop.org/menu-spec/latest/ar01s04.html

Code: Select all
<!DOCTYPE Menu PUBLIC '-//freedesktop//DTD Menu 1.0//EN' 'http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd'>
<Menu>
   <Include>
      <Filename>element1.desktop</Filename>
      <Filename>kde4-kfind.desktop</Filename>
      <Filename>kde4-systemsettings.desktop</Filename>
   </Include>
   <Layout>
      <Menuname>submenu1</Menuname>
      <Menuname>submenu2</Menuname>
      <Filename>element1.desktop</Filename>
      <Filename>kde4-kfind.desktop</Filename>
      <Filename>kde4-systemsettings.desktop</Filename>
   </Layout>
   <Menu>
      <Include>
         <Filename>element2.desktop</Filename>
      </Include>
      <Name>submenu1</Name>
      <Layout>
         <Menuname>submenu3</Menuname>
         <Filename>element2.desktop</Filename>
      </Layout>
      <Menu>
         <Include>
            <Filename>element3.desktop</Filename>
            <Filename>kde4-kfind.desktop</Filename>
         </Include>
         <Name>submenu3</Name>
         <Layout>
            <Filename>kde4-kfind.desktop</Filename>
            <Filename>element3.desktop</Filename>
         </Layout>
         <Directory>submenu3.directory</Directory>
      </Menu>
      <Directory>submenu1.directory</Directory>
   </Menu>
   <Menu>
      <Include>
         <Filename>element4.desktop</Filename>
      </Include>
      <Name>submenu2</Name>
      <Layout>
         <Filename>element4.desktop</Filename>
      </Layout>
      <Directory>submenu2.directory</Directory>
   </Menu>
</Menu>


Does anyone see if the spec is violated somewhere?

Thanks for your time!

K.

PS:
If the xml file is according to the spec there must be some major bug either in kbuildsysoca4 or the kmenu itself since this file does not show the menu it should.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: menu xml file

Sat Jan 23, 2010 10:25 pm
It is extremely unlikely that a major bug exists in kbuildsycoca4 since its operation is essential and critical to the operation of all KDE applications.

The application menus itself is built from the Sycoca.

It is likely you need to get your menu included from another menu that is already included.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
kalle1950
Registered Member
Posts
16
Karma
0

Re: menu xml file

Sun Jan 24, 2010 12:04 pm
I start doubting that there cannot be a major bug. As I understood the specification this is the way it should work:

1. having the above xml file in $HOME/.config/menus/applications-kmenuedit.menu (make a backup of the existing file first!!!!!)

2. run kbuildsysoca4 --noincremental

3. The menu should be as specified in the xml now.

Where did I missunderstood the spec? Do you have a source where this "theory" is contradicted? Do you know anyone who defentely knows if that approach is correct? Do you know a documentation where it is explained how kbuildsysoco works? Or is only the source code the documentation?

Other reasons which backup my opinion:

1. Not only the menu is not as described above but the menu and kmenuedit show different menus as well.

2. I never managed in the past x years (x at least 7) to build a menu using kmenuedit I want to have. Everytime some items got messed up.

3. I never found someone who was able to use kmenuedit without trouble. Backup your xml file and try to build the simple menu from above using kmenuedit. (see my post in discussions & opinions)

4. The spec allows all kind of different operations which have effects on each other, see the tags for delete, include, exclude, merge and some others. This makes an implementation rather error prone.

5. On my systems ${XDG_MENU_PREFIX} (echo $XDG_MENU_PREFIX shows only a blank line ) is not set but should be according to http://standards.freedesktop.org/menu-s ... 01s02.html. So why is menu applications-kmenuedit.menu at all being used? This must be hard coded somewhere. Just an example that I have doubts that the spec is fully implemented.

I only have suse systems available to test maybe it is a suse issue and not a kde issue.

Eager to get some answers, so if you have an idea how to answer them or know someone who can answer them...

Thanks.
K.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: menu xml file

Sun Jan 24, 2010 10:44 pm
I suggest you ask in #kde-devel on Freenode, in particular dfaure who knows about how the Sycoca and its related builders work.

You are likely missing some form of merging of some description.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS

Re: menu xml file

Sat Jan 30, 2010 5:18 pm
kalle1950 wrote:5. On my systems ${XDG_MENU_PREFIX} (echo $XDG_MENU_PREFIX shows only a blank line ) is not set but should be according to http://standards.freedesktop.org/menu-s ... 01s02.html. So why is menu applications-kmenuedit.menu at all being used? This must be hard coded somewhere. Just an example that I have doubts that the spec is fully implemented.


I think $XDG_MENU_PREFIX is only needed for the main menu file and only if it is not called applications.menu.

Unfortunately distributors sometimes patch KDE to look for a different file instead of using the specified mechanism, creating inconsistency when applications which are not part of the distribution (and patch accordingly) install menu files.

Cheers,
_


anda_skoa, proud to be a member of KDE forums since 2008-Oct.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]