Review Request: KMimeTypeFactory: Fix handling of mixed case fast patterns

David Faure faure at kde.org
Mon Jul 12 18:14:33 BST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4442/#review6502
-----------------------------------------------------------

Ship it!


Fix committed to 4.5 branch in 1149120, and to trunk. Please close this request.
Thanks for the contribution!

- David


On 2010-07-01 08:19:31, Anssi Hannula wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/4442/
> -----------------------------------------------------------
> 
> (Updated 2010-07-01 08:19:31)
> 
> 
> 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 
>   /trunk/KDE/kdelibs/kdecore/tests/kmimetypetest.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/20100712/50965eb0/attachment.htm>


More information about the kde-core-devel mailing list