"KDE prefers magic matches over extension matches" -- definitely not true in 
general. We follow the spec exactly, which says that globs (extensions) are 
checked first for performance reason, and that magic is only used if no 
extension matched, or if more than one mimetype had that extension.
And that is exactly the case here: KDE's kde.xml mimetype additions define 
*.doc for text/plain, because not all *.doc files are msword files. Examples 
from my kubuntu system:
/usr/share/doc/texlive-latex-extra-doc/latex/vhistory/README.doc
/usr/share/doc/cvs/contrib/intro.doc

So, yes, for .doc files, we have to rely on magic to determine if they are 
msword or plain text files.
The magic for x-ole-storage (which msword derives from) is supposed to be 
triggered for msword .doc files, and the code can handle that case (the 
matching magic from msword's parent is used to disambiguate msword from 
text/plain).

I see that shared-mime-info 0.50 added magic for msi files
(freedesktop.org bug 16495). If you're saying that magic matches .doc
files, then that magic is wrong I would think (not specific enough, just
generic ole-storage magic). In that case, please consider replying to
freedesktop.org bug 16495 to ask for the removal of this wrong magic. It
would help if you had a sample .doc file that matched it :-) (if it's
really small we could even use it for the shared-mime-info regression
tests)

This would explain why lowering the prio of x-msi to 49 fixes it, btw:
the magic for x-ole-storage then hits first, and the one from x-msi is
out of the way.

I'm not sure why xdg-mime behaves differently though; I wonder if it
implements the conflict resolution properly...

I also wonder why it works here (it's even unit tested, see
kdecore/tests/kmimetypetest.cpp:332-336 or look for "IANA" if the line
numbers don't match). Ah... the data in the unit test is not big enough
for the msi magic to match it. I see.

-- 
icon for ms-word file *.doc is "?" instead of ooo-word
https://bugs.launchpad.net/bugs/285831
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to kdebase-runtime in ubuntu.

-- 
kubuntu-bugs mailing list
kubuntu-b...@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kubuntu-bugs

Reply via email to