Be more precise with mimetype detection
ClosedPublic

Authored by astippich on Mar 24 2019, 10:48 AM.

Details

Summary

Use the new mime type helper from KFileMetaData

CCBUG: 403902

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
astippich created this revision.Mar 24 2019, 10:48 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptMar 24 2019, 10:48 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
astippich requested review of this revision.Mar 24 2019, 10:48 AM

Ideally Qt would provide this, but I could not find any

astippich edited the summary of this revision. (Show Details)Mar 24 2019, 10:57 AM
bruns requested changes to this revision.Mar 25 2019, 1:59 PM
bruns added inline comments.
src/file/extractor/app.cpp
148

This only works correctly when the actual mimetype is the preferred one for this extension. See
https://doc.qt.io/qt-5/qmimedatabase.html#mimeTypesForFileName

Mismatching file (should be graphviz):

$> cat test.dot

# some comment
graph {}
155

This should be a standalone function, to reuse it in e.g. the baloo-widgets temp extractor

This revision now requires changes to proceed.Mar 25 2019, 1:59 PM
astippich updated this revision to Diff 54959.Mar 27 2019, 8:01 PM
  • use new mime type helper
astippich edited the summary of this revision. (Show Details)Mar 27 2019, 8:02 PM
astippich edited the test plan for this revision. (Show Details)
bruns accepted this revision.Mar 27 2019, 8:03 PM
This revision is now accepted and ready to land.Mar 27 2019, 8:03 PM
This revision was automatically updated to reflect the committed changes.