Created attachment 107644 [details] dolphin recogizes as MATLAB Many text files on my system are identified as 'MATLAB script/function' including /etc/nanorc, /etc/pacman.d/mirrorlist.pacnew, and a markdown file that uses the .md extension. In the last case, I don't see why dolphin should try to guess what type of file it is if it uses a recognized file extension. Is there any reason why the extension is not the primary means of identifying file types?
Created attachment 107645 [details] dolphin recogizes as MATLAB
(In reply to rasq37 from comment #0) > Created attachment 107644 [details] > dolphin recogizes as MATLAB > > Many text files on my system are identified as 'MATLAB script/function' > including /etc/nanorc, /etc/pacman.d/mirrorlist.pacnew This happens because of this rule in the shared-mime-info database: <magic priority="10"> <match type="string" value="##" offset="0"/> </magic> So any text file whose first line starts with two or more '#' will be identified as matlab script (unless an higher priority rule says otherwise). > and a markdown file that uses the .md extension. Can't reproduce this, the .md extension should rule out Matlab. Can you attach a test file? > In the last case, I don't see why dolphin > should try to guess what type of file it is if it uses a recognized file > extension. Is there any reason why the extension is not the primary means of > identifying file types? In general, extensions may be missing or wrong.
The markdown file was the same issue; it started with '##'. > (unless an higher priority rule says otherwise) I tried changing that rule's priority, but it didn't seem to have any effect so I just removed it instead. Is is possible that Dolphin isn't reading the priorities correctly? Could this explain the fact that I have to remove the *.iso pattern from everything but application/x-cd-image to prevent Dolphin from listing half of my iso files as plain text? Regardless, this rule seems like a bad idea. Any text file can start with ##, that shouldn't identify it as MATLAB. I think this is still deserving of a bug report, but does it have anything to do with Dolphin, or any other KDE project? If not, where should it go?
(In reply to rasq37 from comment #3) > The markdown file was the same issue; it started with '##'. > > > (unless an higher priority rule says otherwise) > > I tried changing that rule's priority, but it didn't seem to have any effect > so I just removed it instead. Is is possible that Dolphin isn't reading the > priorities correctly? Could this explain the fact that I have to remove the > *.iso pattern from everything but application/x-cd-image to prevent Dolphin > from listing half of my iso files as plain text? That's https://bugs.freedesktop.org/show_bug.cgi?id=80877 > > Regardless, this rule seems like a bad idea. Any text file can start with > ##, that shouldn't identify it as MATLAB. I think this is still deserving of > a bug report, but does it have anything to do with Dolphin, or any other KDE > project? If not, where should it go? Here: https://bugs.freedesktop.org/ (against the shared-mime-info product)