![]() Registered Member ![]()
|
ok, another question.
I would like to retrieive the items in the kmenu with my application (and also all the submenus). I searched everywhere (api, tutorial, documentation, source code of some plasma-application) but I found absolutely nothing about this (a lot of source code of plasma-application is NOT well commented ![]() what kind of object in the api i have to use? thanks in advance
My belly is full of theory but when I play I forget it all - Al di Meola
-------------- darkman, proud to be a member of KDE forums since 2008-Nov. |
![]() Registered Member ![]()
|
The contents of ~/.config/menus/applications-kmenuedit.menu MIGHT be what you're looking for. |
![]() Registered Member ![]()
|
no, it's not what i'm looking for... atch! this file doesn't have the information that i'm looking for. i'm trying to create an alternative applet-menu with plasma. so i would like to retrieve the structure of the menù in kde (and visualize them). for example... this may be a structure of my menu: Multimedia -->amarok -->mplayer ... Office -->oowriter -->acroread Wine -->somethingelse and so on. Ok, i'll try to explain me in other words. If i take a look at my menu (i'm using lancelot) in kde i see that there is a "structure". all applications can be found within a few submenus. If I try to use any other menu (for example, the standard in kde) I see that the "structure" remains unchanged. So, I assume that there is a way to read this "structure" in the menu. I think that there is an object or a query that gives me these informations. uhm .. it is clear what I'm looking for?
My belly is full of theory but when I play I forget it all - Al di Meola
-------------- darkman, proud to be a member of KDE forums since 2008-Nov. |
![]() Administrator ![]()
|
You would probably use KDesktopFile to read the information from the files.
KServiceTypeTrader can probably help you with retrieving the list of all the applicable files. Real Usage of them can be found through lxr.kde.org The Documentation is available from api.kde.org
Last edited by bcooksley on Mon Feb 23, 2009 6:01 am, edited 1 time in total.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Thank you. it's exactly what i was looking for!
Last edited by darkman on Tue Feb 24, 2009 7:41 pm, edited 1 time in total.
My belly is full of theory but when I play I forget it all - Al di Meola
-------------- darkman, proud to be a member of KDE forums since 2008-Nov. |
![]() Registered Member ![]()
|
i think it's a bit complicated, but it works.... (if someone of you have a better idea, please tell me
![]() hope it will be usefull
Well, the categories that this code returns it exactly what the filed "Categories" says in the .dektop files. Sometimes this field has many cateogies instead of only one. Often these categories don't match with the category in the kmenu.. ufff... uff... how can i do? For example: The application the program says that Ardour is in the category Audio (and something else), but in ALL kmenus it's located under "Multimedia". Maybe i don't have to look at "category" field, but where can i find the information i want?
Last edited by darkman on Tue Feb 24, 2009 10:46 pm, edited 1 time in total.
My belly is full of theory but when I play I forget it all - Al di Meola
-------------- darkman, proud to be a member of KDE forums since 2008-Nov. |
![]() Administrator ![]()
|
Maybe categories themselves have "Categories"?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
uhm... boh!
i don't know, i don't understood too much. the field "category" doesn't have more informations. I took a look at the application "kmenuedit" and "kickoff". i read a lot of its code (uncommented :-@) but i haven't yet found nothing that may help me. both applications don't use any "query" as i do, so i think that i have to search elsewhere the solution of my problem. [ot] ps: why people that develop application for kde don't make comments in the source code? :-@ [/ot] ---------------------------------------------------------------------------------------------------------- taking a look at kickoff source code i found:
Don't ask me the meaning of what i've done... i don't know, but it works! ![]() Hope this helps
Last edited by darkman on Thu Feb 26, 2009 9:36 am, edited 1 time in total.
My belly is full of theory but when I play I forget it all - Al di Meola
-------------- darkman, proud to be a member of KDE forums since 2008-Nov. |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell