From kde-devel Fri Sep 30 05:27:55 2005 From: Chakkaradeep C C Date: Fri, 30 Sep 2005 05:27:55 +0000 To: kde-devel Subject: Re: Hi all Message-Id: X-MARC-Message: https://marc.info/?l=kde-devel&m=112805743608736 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1467030754==" --===============1467030754== Content-Type: multipart/alternative; boundary="----=_Part_1957_8680998.1128057355417" ------=_Part_1957_8680998.1128057355417 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Aaron, >in that case you won't want to follow the groupings as provided by >KServiceGroup. you'll just want to get all the applications available and >store them in your own tree arrangement. you can query sycoca (sycoca =3D= =3D >SYstem COnfiguraton CAche) by application name or keywords. can you please provide a small example for the above?....i went thru " kservicegroup.h" and i did saw an example for geting "screensavers".In the same way how can i find the programs installed?.. and, in the Menu creation, where do we 'draw' the Menu?..i want to do something like WindowsXP start Menu... and, in the Menu creation code...in the "service_mnu.cpp", ********************code***************************************************= ******************************* PanelServiceMenu * m =3D newSubMenu(g->name(), g->relPath(), this, g->name().toUtf8(), inlineHeaderName); ********************code***************************************************= ******************************* does the above code create a new menu?...so when i check for "KST_KServiceGroup", i get all the Parents..that is "Accessories","Games","Development" etc.,.And is the line below which adds them?.. "int newId =3D insertItem(iconset, groupCaption, m, id++);"?? and when it comes to "KST_KService", how are those items added as child to their respective "KST_KServiceGroup" in the insertMenuItem( ) function.?? I really feel very hard to grasp things as am new to KDE Programing...i would be very hapy if people could help me out.. thanks in advance... with regards, C.C.Chakkaradeep On 9/28/05, Aaron J. Seigo wrote: > On Wednesday 28 September 2005 00:32, Chakkaradeep C C wrote: > > Hi all, > > > > >> was unable to find where the "Applications" Menu gets added. > > > > > >that happens in PanelServiceMenu. KMenu::initialize() makes a call to > > >PanelServiceMenu::initialize() which calls doInitialize which call > > > fillMenu > > > > i got the above function, but now since i want to place the application= s > in > > my own custom group name rather than using > "Application,Development,Games", > > how should i proceed...does kappfinder plays a role here?.. > > in that case you won't want to follow the groupings as provided by > KServiceGroup. you'll just want to get all the applications available and > store them in your own tree arrangement. you can query sycoca (sycoca =3D= =3D > SYstem COnfiguraton CAche) by application name or keywords. > > > what does, > > "KServiceGroup::Ptr g(static_cast(e));" statement > > do? > > e and e1 are KSycocaEntry objects; KServiceGroup is a KSycocaEntry > subclass > that represents a group of "services" (in this case, application entries > as > described by .desktop files). so this cast is necessary to change the > pointer > type from a KSycocaEntry to a KServiceGroup. > > > if ( nbChildCount =3D=3D 1 && g->allowInline() && g->inlineAlias()) > > this bit of code just inlines submenus of only one item. so this: > > Menu A > Menu B > Item 1 > Menu C > Item 2 > Item 3 > Item 4 > Item 5 > Item 6 > > becomes: > > Menu A > Menu C > Item 2 > Item 3 > Item 1 > Item 4 > Item 5 > Item 6 ------=_Part_1957_8680998.1128057355417 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi Aaron,

>in that case you won't want to follow the groupings as provide= d by
>KServiceGroup. you'll just want to get all the applications ava= ilable and
>store them in your own tree arrangement. you can query sy= coca  (sycoca =3D=3D
>SYstem COnfiguraton CAche) by application name or keywords.
 
can you please provide a small example for the above?....i went thru &= quot;kservicegroup.h" and i did saw an example for geting "screen= savers".In the same way how can i find the programs installed?..
 
and,
 
in the Menu creation, where do we 'draw' the Menu?..i want to do somet= hing like WindowsXP start Menu...
 
and,
 
in the Menu creation code...in the "service_mnu.cpp",
********************code**********************************************= ************************************
PanelServiceMenu * m =3D
       =          newSubMenu(g->name(), g= ->relPath(), this, g->name().toUtf8(), inlineHeaderName);
********= ************code***********************************************************= ***********************
 
does the above code create a new menu?...so when i check for "KST= _KServiceGroup", i get all the Parents..that is "Accessories"= ;,"Games","Development" etc.,.And is the line below whi= ch adds them?..
"int newId =3D insertItem(iconset, groupCaption, m, id++);"?= ?
 
and when it comes to "KST_KService", how are those items add= ed as child to their respective "KST_KServiceGroup" in the insert= MenuItem( ) function.??
 
I really feel very hard to grasp things as am new to KDE Programing...= i would be very hapy if people could help me out..
 
thanks in advance...
 
with regards,
C.C.Chakkaradeep
 
 
On 9/28/05, = Aaron J. Seigo <aseigo@kde.org= > wrote:
On Wednesday 28 September 2005 0= 0:32, Chakkaradeep C C wrote:
> Hi all,
>
> >> was = unable to find where the "Applications" Menu gets added.
> >
> >that happens in PanelServiceMenu. KMenu::initiali= ze() makes a call to
> >PanelServiceMenu::initialize() which calls= doInitialize which call
> > fillMenu
>
> i got the ab= ove function, but now since i want to place the applications in
> my own custom group name rather than using "Application,Devel= opment,Games",
> how should i proceed...does kappfinder plays a = role here?..

in that case you won't want to follow the groupings as = provided by
KServiceGroup. you'll just want to get all the applications available a= nd
store them in your own tree arrangement. you can query sycoca &n= bsp;(sycoca =3D=3D
SYstem COnfiguraton CAche) by application name or key= words.

> what does,
> "KServiceGroup::Ptr g(static_cast<KServ= iceGroup *>(e));" statement
> do?

e and e1 are KSycoca= Entry objects; KServiceGroup is a KSycocaEntry subclass
that represents = a group of "services" (in this case, application entries as
described by .desktop files). so this cast is necessary to change the p= ointer
type from a KSycocaEntry to a KServiceGroup.

> if ( nbC= hildCount =3D=3D 1 && g->allowInline() && g->inlineAl= ias())

this bit of code just inlines submenus of only one item. so this:
       Menu A
   &nbs= p;           Menu B
&n= bsp;            = ;          Item 1
 &nb= sp;            = Menu C
          &nbs= p;            Item 2=
            = ;           Item 3
            = ;   Item 4
        &nb= sp;      Item 5
     &= nbsp;         Item 6

becomes= :

       Menu A
   &= nbsp;           Menu C            &n= bsp;          Item 2
 =             &nb= sp;         Item 3
  &= nbsp;            Ite= m 1
            = ;   Item 4
        &nb= sp;      Item 5
     &= nbsp;         Item 6
 
 
------=_Part_1957_8680998.1128057355417-- --===============1467030754== Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline = >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib= e << --===============1467030754==--