Bug 196212

Summary: kmimetypefinder guess incorrect type despite file extension
Product: [Unmaintained] kdelibs Reporter: Paul L. D. Roberts <raulpoberts>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: parejaobregon
Priority: NOR    
Version: 4.2.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Paul L. D. Roberts 2009-06-12 17:59:19 UTC
Version:            (using KDE 4.2.2)
OS:                Linux
Installed from:    Ubuntu Packages

kmimetypefinder guesses the wrong file type for *.m files with '%' as the first character:

~$ echo "%" > test.m
~$ kmimetypefinder test.m
text/x-tex
(accuracy 10)
~$ xdg-mime query filetype test.m
text/x-objcsrc

As far as I know text/x-tex files do not have a .m extension so it seems like the "correct" behavior in this case would be to select a mime type which agrees with both the file content and the file extension.
Comment 1 Andrew Crouthamel 2018-11-02 22:56:29 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 2 Andrew Crouthamel 2018-11-16 05:34:14 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version?

Thank you for helping us make KDE software even better for everyone!
Comment 3 parejaobregon 2018-11-28 02:39:24 UTC
(In reply to Andrew Crouthamel from comment #2)
> Dear Bug Submitter,
> 
> This is a reminder that this bug has been stagnant for a long time. Could
> you help us out and re-test if the bug is valid in the latest version?
> 
> Thank you for helping us make KDE software even better for everyone!

If it adds any information, I used to have the same problem, but I just tested the issue on Debian stable (stretch) and it seems to be gone (ie, it is currently working as expected).

Version:           KDE Plasma 5.8.6 - KDE Frameworks 5.28.0 - Qt 4.9
OS:                Linux
Installed from:    Debian main repository

kmimetypefinder currently seems to be guessing the right file type for *.m files with '%' as the first character (at least under my current configuration):

~$ echo "%" > test.m
~$ kmimetypefinder test.m
text/x-matlab
(accuracy 100)
~$ xdg-mime query filetype test.m
text/x-matlab
Comment 4 Christoph Feck 2018-12-20 03:25:21 UTC
Thanks for the update; changing status.