Port away from KMimeType
ClosedPublic

Authored by broulik on Dec 31 2016, 3:32 PM.

Details

Summary

Except for KMimeType::isBinaryData - there's also no mention of it on the wiki page.

Test Plan

Searching for all files, for "all image/video/audio files" and for specific mime types works

Diff Detail

Repository
R228 KFind
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik updated this revision to Diff 9555.Dec 31 2016, 3:32 PM
broulik retitled this revision from to Port away from KMimeType.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added a reviewer: dfaure.
broulik set the repository for this revision to R228 KFind.
dfaure requested changes to this revision.Dec 31 2016, 3:44 PM
dfaure edited edge metadata.
dfaure added inline comments.
src/kftabdlg.cpp
467

missing a .reserve() call.

This means putting the result of allMimeTypes() into a local var.

470

Does this actually happen?

Otherwise it would be faster to just initialize mimeTypes to the result of allMimeTypes.

476

missing space before '='

478

strange capitalization

This revision now requires changes to proceed.Dec 31 2016, 3:44 PM
broulik updated this revision to Diff 9569.Dec 31 2016, 9:27 PM
broulik edited edge metadata.
  • Simplify by just using allMimeTypes directly
  • Fix capitalization
broulik marked 4 inline comments as done.Dec 31 2016, 9:27 PM
dfaure accepted this revision.Jan 3 2017, 8:50 AM
dfaure edited edge metadata.

Indeed there's no direct replacement for isBinaryData (it's a private method in qmimedatabase.cpp now, part of the mimetype determination algorithm). What was it used for, here? Maybe mimeTypeName.startsWith("text/") || mimeType.inherits("text/plain") is a close enough approximation?

src/kftabdlg.cpp
737

The (int) cast is 1) ugly (I hate C casts), 2) unnecessary ;)

This revision is now accepted and ready to land.Jan 3 2017, 8:50 AM

Why it was not commited ?

This revision was automatically updated to reflect the committed changes.