setting mimetype prefs

David Faure dfaure at trolltech.com
Fri Aug 22 19:06:00 BST 2003


On Thursday 21 August 2003 15:54, Gav Wood wrote:
> On Thursday 21 August 2003 12:39, Gav Wood wrote:
> > hi,
> >
> > i'm trying to write some code that manipulates the mime type preference
> > order; i've looked all over the class docs, howtos, and even tryed to
> > figure out how the kcm does it.
> >
> > by looking at the kcm code there doesn't appear to be a nice
> > "KServiceType:: makePreferedService(KMimeType::Ptr )" or the like. is there
> > an easy way to do it, or will i have to take hints from the kcm?
> 
> assuming the answer to this is "no, you'll have to do it the hard way"
Yes.

> , i have  
> since done it the hard way (taking hints from kcmfiletypes) and made a (imho) 
> fairly robust method for setting a prefered service for a given mimetype. is 
> it worth a patch to kdelibs; say KMimeType::setPreferedService() or 
> KServiceType::makePreferedService()?

Possibly (if you used to 'r' in preferred :).

[I'm not sure I want to see apps making themselves the preferred handler
for a mimetype using this though.... But I realize this isn't a real argument since
apps could do this by hand anyway, it just makes it easier].

Anyway I'm more and more wondering if "profilerc" is a good design for this.
The XDG list mimetype standard (which we don't use yet) suggests to have
a preference number in the .desktop files, and to change it (in the user's
local desktop files) when the order is changed. This would solve many of
the problems with profilerc, in particular stuff like Waldo's recent fix when
.desktop files are moved around, or problems like "the new service I just
installed doesn't show up because I have a profilerc" etc.

What do you think?

-- 
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