Missing KServiceType Info

David Faure faure at kde.org
Thu Feb 1 20:23:16 GMT 2007


Wow this was long ago. Sorry about that.

On Thursday 01 February 2007, ian geiser wrote:
^ Interesting kmail bug... It was in fact on 2005-02-08.

> On Tuesday 08 February 2005 09:06 am, David Faure wrote:
> > > All this confusion seems like overkill, basicly all i  
> > > really wanted to do was get the possible properties for each service via
> > > some API.
> >
> > KServiceType::propertyNames is supposed to be that.
> I have attached some sample code that displays:
> servicetypetest: Get props for: 'KDevelop/Plugin' from kdevelopplugin.desktop
> servicetypetest: Found Property: Name
> servicetypetest: Found Property: Comment
> servicetypetest: Found Property: Icon
> 
> My understanding of the KServiceType tells me that it should give me this:
> servicetypetest: Get props for: 'KDevelop/Plugin' from kdevelopplugin.desktop
> servicetypetest: X-KDevelop-Version
> servicetypetest: X-KDevelop-Scope
> servicetypetest: X-KDevelop-Mode
> servicetypetest: X-KDevelop-Plugin-Version
> servicetypetest: X-KDevelop-Plugin-Homepage
> servicetypetest: X-KDevelop-Plugin-License
> servicetypetest: X-KDevelop-Plugin-BugsEmailAddress
> servicetypetest: X-KDevelop-Plugin-Copyright
> servicetypetest: X-KDevelop-Properties
> servicetypetest: X-KDevelop-ProgrammingLanguages
> servicetypetest: X-KDevelop-Args

OK, I had a look, and my hint was wrong. Those are property definitions, not properties.
KServiceType::propertyDefNames() lists them, and is what you were looking for.

A servicetype property is one value associated to a servicetype (e.g. its Name or Comment,
or anything else defined in the servicetype .desktop file using
[Property::MyPropertyName]
Type=<the name of a type supported by QVariant>
Value=<the value>

A servicetype "property definition", on the other hand, defines a property that
the *services* (implementing this servicetype) have. Like in your case.
[PropertyDef::X-KDevelop-Version]
Type=int
means that all kdevelop plugins have in their .desktop file a line like
X-KDevelop-Version=<some value>

I guess the need is gone by now :( but at least I improved the apidox in trunk.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kde-core-devel mailing list