Registered Member
|
Hello,
I tried to look for documentation about the inner working of KDE but what I found was very old (KDE3) or incomplete. I hope somebody can point me to the right place so that I can find the right documentation. What I want to know is, how to write an installer that installs a program on top of KDE. So what I want to know is, where are the files that contain the entries for the startmenu, and where are the files that contain the info about the link between the file extensions and the the default program to use. How to edit those files, how to write a .desktop file, etc. Thanks in advance. |
Administrator
|
The Menu itself and file extension associations are controlled by XDG specifications. Documentation for them can likely be found on freedesktop.org.
The Default application is likely determined through the same method I believe.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Thanks, that helped me a lot.
Now I have another problem. I created a myapp.desktop file with the following content:
I created a script with the following content:
I run the script as root. However, there is no menu entry created. When I manually copy the myapp.desktp file to ~/desktop/ it works fine. Why isn't the menu entry created in KDE4? I checked the script, all the files are copied into the right places. According to http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html#category-registry:
Any ideas? |
Administrator
|
You may need to run "kbuildsycoca4" (as the user, not root) for KDE to detect it.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Unfortunately, that didn't help. After some more reading, I extended the script with two extra commands:
and the content of the file "myapp.xml" is:
And I extended the file myapp.desktop:
But still, no menu entry... The strange thing is, when I run this script on a Gnome desktop (Ubuntu), the menu entry is created, but myapp is not the preferred app for the respective file associations. With KDE4 (openSuse), there is no menu entry but myapp is the preferred application for the respective file-extensions. Any ideas? I'm thinking about to file a bugreport. Regards, Teuniz |
Administrator
|
If you add Qt and KDE to your list of categories, and remove Application, does it show up now?
The reason for KDE giving you the preference for those file extensions is that KDE fully honours the MimeType line in *.desktop files. GNOME either may not have those mimetypes registered (KDE ships with a set of mimetypes which extend the base ones they both share), or requires that they be specified in XML files (similar to the menu ones, but slightly different)
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I removed the .menu file from the installer en added some other commands.
Now it seems to work completely on openSuse & KDE4 and Ubuntu & Gnome. The new content of the install script:
However, there's only one weird thing left on opensuse. In the menu-entry, myapp has a default icon (Pi symbol). I don't know why. In the recent used apps list, the myapp icon is used. Also in the "recently installed" menu, the icon is ok.
Last edited by Teuniz on Tue Jul 19, 2011 2:51 pm, edited 1 time in total.
|
Administrator
|
This may be due to the icon cache. Logging out and back in may fix this.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Unfortunately, this does not help. |
Administrator
|
You are aware that the "Icon" entry in "myapp.desktop" needs to match the name of your icon right? In this case, it needs to be "edf" as that is the name of the file in hicolor/<size>/apps/
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Yes, I know. I tried some other tests. Some time ago, I installed skype. So, I checked what files are in the skype-rpm and where they are installed. Also, I opened the file "skype.desktop" with kate to view the content. What is different, is the categories section. With skype it's: Network;Application; I changed the categories section of myapp.desktop to Network;Application; as well and the result is, apart from that myapp is now in another menu entry called "Applications" together with skype, the icon works! However, if I change back the categories section to Education;Science;DataVizualition; myapp will be moved to the menu entry "Edutainment" and the icon is wrong, it's the default Pi symbol. If I edit and change the categories section of skype.desktop to Education;Science;DataVizualition; skype will move to the "Edutainment" menu entry and have the default Pi symbol as an icon! So, it looks like there is a bug in (at least openSuse's implementation of) KDE4. |
Administrator
|
It may be possible that being under the Data Visualisation category (which seems to be spelt wrongly there.... which is odd) causes a different icon name prefix to be used as part of the name. As the now altered icon name won't be found, it falls back to the generic icon for that category.
Does it work in just Education;Science?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I spelled wrong here, indeed it was "Categories=Education;Science;DataVisualization;" like spelled at http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html#category-registry When I change it to Categories=Education;Science; the icon changes to the default laboratory/chemistry icon When I change it to Categories=Education; myapp will be moved to a new menu entry called "Applications" but it will have the myapp icon! For the moment, this is the content of myapp.desktop:
The content of myapp.xml:
The content of myapp.mime:
and finally the install script that works on Ubuntu with Gnome and openSuse with KDE4:
It looks like openSuse/KDE4 does not comply to the recommendations at http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html#category-registry where it states that
|
Administrator
|
I would recommend sending an email to the kde-devel@kde.org mailing list in regards to this issue. There may be a bug in the menu itself. Please make sure to include a screenshot of the menu not working properly.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell