[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: A great idea! (?)
From:       David Faure <faure () alpha ! tat ! physik ! uni-tuebingen ! de>
Date:       1999-05-25 8:12:10
[Download RAW message or body]

On Tue, May 25, 1999 at 09:16:27AM +0200, Stefan van den Oord wrote:
> On Sun, 23 May 1999, David Faure wrote:
> >> I mean that when you create a new mime type, you could provide a file
> >> as a sample of the type of files you want to bind. So if you want to
> >> bind TAR-GZ files (but to their type, not their extension), you
> >> would select a TAR-GZ file. 
> >This is not enough for mime-magic to work !!
> >Have a look at the 'magic' file...
> 
> I see what you mean. But I am just looking at it from the user's
> point of view; I am curious whether this is considered a useful
> feature.
"This" = "magic mimetype recognition" ?
It is useful, I can guarantee this to you !

> >> Same for all other files. You're right
> >> that I can type "application/text" in the mime type field, but that
> >> is hardly user-friendly.
> >There is a GUI for this, you don't have to type anything.
> 
> You're right, I was mistaken. But still I have plain text files that
> are not recognized by KDE (it asks me what application to open the
> file with). The `file' command says: "International language text".
kfm doesn't use the 'file' command. It uses a similar mechanism
(borrowing code from it), but not EXACTLY the same thing, since
we don't want a long string that describes the mimetype - instead we want 
the mimetype itself. "text/plain" for instance. Have a look at 
kmimemagic.cpp (in KDE-1.1.x, in kdebase/kfm) or kmimemagic.cc in kdelibs/kio.

> But, looking at the /usr/share/magic, I wonder if this type is
> recognized due to some magic, because I can't find the entry that
> could lead to "International language text".
Look at kdelibs/kio/magic, not /usr/share/magic

> But even without having a magic entry KDE could recognize the file,
> namely by issuing the `file' command and comparing its output against
> some internal database...
Nah.
This relies on the wrong 'magic' file.

-- 
David FAURE
david.faure@insa-lyon.fr, faure@kde.org
http://www.insa-lyon.fr/People/AEDI/dfaure/index.html 
KDE, Making The Future of Computing Available Today

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic