Review Request: KMimeTypeFactory: Fix handling of mixed case fast patterns
Anssi Hannula
anssi at mandriva.org
Wed Jun 23 06:34:34 BST 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4442/
-----------------------------------------------------------
Review request for kdelibs.
Summary
-------
A mimetype glob is put into the "fast pattern" list when its weight is 50, it is in simple "*.foo" format, and it is case-insensitive (KBuildMimeTypeFactory::savePatternLists()). The pattern is lowercased when put into the fast pattern list. When MimeTypeFactory::findFromFastPatternDict() finds a match for a file extension, it checks the returned mimetype to make sure its patterns() list contains the searched pattern. However, the patterns() list contains the patterns in their original format, which may contain mixed case characters, therefore failing the test and the correct mimetype is not returned.
Fix that by adding Qt::CaseInsensitive to the .contains() call.
The two other pattern lists (low weight patterns and high weight patterns) are not affected as KMimeTypeFactory::findFromOtherPatternList() doesn't recheck the patterns() list of the returned mimetype.
This bug affects 4.4 branch as well.
Diffs
-----
/trunk/KDE/kdelibs/kdecore/services/kmimetypefactory.cpp 1141627
Diff: http://reviewboard.kde.org/r/4442/diff
Testing
-------
"kde-open file.EZHex", while the MIME type was defined with a glob "*.EZHex" (from libconcord/congruity).
Before the patch it was opened in a web browser (*.EZHex files are XML based data), after the patch it is opened in the correct application associated with "*.EZHex".
Testing was done on a KDE 4.4 system, but the relevant code seems to be the same in trunk.
Thanks,
Anssi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100623/3c05ef1b/attachment.htm>
More information about the kde-core-devel
mailing list