Servicetype inheritance (Re: kdenonbeta/kopete/libkopete)

Waldo Bastian bastian at kde.org
Tue Apr 22 21:16:50 BST 2003


On Tuesday 22 April 2003 19:31, David Faure wrote:
> I see only two solutions:
>
> 1) "if it's a mimetype then reverse the logic" in the
> (KService::hasServiceType) code. Looks ugly, but it's the simplest fix, and
> if I paste the whole mail above as comment, I guess the code would then
> make sense :)
>
> 2) Implementing a new kind of inheritance, with the opposite meaning.
> X-KDE-Derived was up to now only used for servicetypes,
> so I suggest that we introduce a new inheritance scheme for
> mimetypes, say X-KDE-ParentMimeType or whatever.
> However X-KDE-Derived wouldn't make much sense for mimetypes, and
> X-KDE-ParentMimeType wouldn't make sense for servicetypes, so in
> the end we don't gain much, it's a bit more confusing, and we have much
> more code to write, duplicating the logic but inversing it....
>
> Thoughts?

A mimetype Axxx is a servicetype describing the ability to open files of type XXX. 
X-KDE-Derived describes inheritance in terms of servicetypes. So if you have a 
servicetype that inherits from a certain mimetype Afoo, then you inherit the ability to
open files of type FOO, ergo if you have a mimetype that inherits from a certain 
mimetype Afoo, then you inherit the ability to open files of type FOO. In practice 
that doesn't make sense because you would end up saying that text/plain inherits 
from text/html.

What you want is an ability to tell that when a file is of a certain mimetype that this implies
that this file meets the criteria of another mimetype as well: text/html is also text/plain.

Those are two different concepts that should be treated as such. So I would go for solution 
2. I'm sure it will be more work but usually it pays off to have a design that reflects the
underlying concepts.

I would name it X-KDE-IsAlso. I hope to get a similar property adopted in the shared 
mimetype spec. (http://www.freedesktop.org/standards/shared-mime-info.html)

Cheers,
Waldo
-- 
bastian at kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian at suse.com





More information about the kde-core-devel mailing list