[KRun] Check mime type for isExecutableFile first
ClosedPublic

Authored by broulik on Sep 2 2019, 8:36 AM.

Details

Summary

The mime type is passed into the function, so it's already known. Checking mime type inheritance then is quick.
This avoids accessing the file in QFileInfo::isExecutable() potentially blocking just to then realize it's none of the mime types we care about.

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Sep 2 2019, 8:36 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 2 2019, 8:36 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Sep 2 2019, 8:36 AM
dfaure accepted this revision.Sep 2 2019, 1:00 PM

Makes sense.
In D22510 I actually suggested splitting this method into two, but the all-in-one method will still be used by isPromptNeeded, so this can go in.

This revision is now accepted and ready to land.Sep 2 2019, 1:00 PM

will still be used by isPromptNeeded, so this can go in.

Speaking of which, that prompt check should be done after the mimetypejob has finished, not casually blocking everything in synchronous mime type determination beforehand :)

This revision was automatically updated to reflect the committed changes.