Add a helper to determine actual supported parent mime type
ClosedPublic

Authored by bruns on Mar 31 2019, 2:15 AM.

Details

Summary

The ExtractorCollection::fetchExtractors method falls back to ancestor
mime types in case a type is not supported directly. For most extractors
this is no problem, as these ignore the passed in mime type and rely
on the backing library to figure out the type, while the taglibextractor
requires one of the supported (container) types.

For most cases the input type is returned, but it falls back to
inheritance, matching the logic from ExtractorCollection::fetchExtractors.

Diff Detail

Repository
R286 KFileMetaData
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Mar 31 2019, 2:15 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptMar 31 2019, 2:15 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Mar 31 2019, 2:15 AM
ngraham added inline comments.Mar 31 2019, 2:27 AM
src/extractorplugin.h
106

Since when? :p

bruns added inline comments.
src/extractorplugin.h
106

too early ;-)

bruns updated this revision to Diff 55104.Mar 31 2019, 2:43 AM

fill in @since

Shouldn't this go into MimeUtils?

astippich accepted this revision.Mar 31 2019, 12:43 PM

Forget my comment, I thought it would be possible to share some code with the ExtractorCollection, but the implementation is too different

This revision is now accepted and ready to land.Mar 31 2019, 12:43 PM

Oh, another idea: Cannot this be used to determine that the extractor supports the inheriting mimetype as required in D20121? Would need to be public for this, though, or the test needs to be made a friend class.

bruns added a comment.Mar 31 2019, 2:50 PM

Oh, another idea: Cannot this be used to determine that the extractor supports the inheriting mimetype as required in D20121? Would need to be public for this, though, or the test needs to be made a friend class.

A friend declaration should work there. It should stay protected, as it is meant to be called by plugins only.

This revision was automatically updated to reflect the committed changes.