Skip to content

Update shared-mime-info to the 2.1 release, adjust implementation

David Faure requested to merge dfaure/qtbase:work/dfaure/0cbbba2a into kde/5.15

The spec hasn't changed, but I made the same mistake in xdgmime (the reference implementation) and in Qt: when multiple globs match, and the result from magic sniffing is unrelated to any of those globs, then I used the magic result, but that's wrong, globs have priority and one of them should be picked up.

This is now fixed in xdgmime ( and in the expected results in shared-mime-info ( which this commit is also tested against.

This change also optimizes QMimeBinaryProvider::addFileNameMatches to have the same logic as xdgmime for glob matching: literals > extensions > other globs As soon as one category matches, we can stop there. This makes no difference in the overall results, in practice.

The user bug report (against the Qt implementation, actually) is as well as

Pick-to: 6.0 5.15 Change-Id: Ia0a34080427daff43c732609443ee6df8f41447c Reviewed-by: Thiago Macieira (cherry picked from commit 0cbbba2a)

Merge request reports