Does KMimeMagic really work with config/magic/*.magic files ?
David Faure
faure at kde.org
Fri Feb 20 22:45:53 GMT 2004
On Friday 20 February 2004 23:34, Guillaume Laurent wrote:
> I'm trying to add a "magic mimetype" for rosegarden files. It's copied from
> KOffice's old type. If I add the line
>
> >10 string audio/x-rosegarden\000 audio/x-rosegarden
The leading ">" means continuation...
This line alone doesn't make sense, it would have to follow a line that doesn't start with a ">".
If you mean "at offset 10", remove the ">".
If you mean "at offset 10 or more" - this is not implemented.
> However, what I would like is to have it in a seperate file which can be
> installed. Looking at KMimeMagic's ctor, I should be able to put that in a
> file in $KDE/share/config/magic/rosegarden.magic.
Yes.
> If I do, that file is read
> and parsed, but rg files aren't recognized (it's as if the file wasn't there
> at all, yet I know it's parsed).
Try without the ">". If it still doesn't work, you might have the problem that
anything in the main magic file has priority over the rest - if a rule matches there,
however generic it might be, any following rule (later in the file or in a *.magic file)
won't be even looked at. So this doesn't work for e.g. ZIP-derived formats.
--
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