[UDevManager] Also explicitly query for cameras
ClosedPublic

Authored by broulik on Mar 14 2018, 12:05 PM.

Details

Summary

Only camers with ID_GPHOTO2=1 are considered by the backend so we might as well just query for those in the first place.

Test Plan

Forgot that when resurrecting David's previous patch

My phone still shows up fine as "Camera" when connected via PTP instead of MTP

Saves 70ms time on plasmashell startup for me (hotplugengine)

Diff Detail

Repository
R245 Solid
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.Mar 14 2018, 12:05 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 14 2018, 12:05 PM
broulik requested review of this revision.Mar 14 2018, 12:05 PM

didn't we establish that devicesByProperty didn't work?

didn't we establish that devicesByProperty didn't work?

It didn't work for media players where we query for QVariant() which turns into nullptr since there is no documentation on what that actually does (remove filter or check for property existance). Explicitly checking for 1 which we do here works fine, though.

davidedmundson accepted this revision.Mar 15 2018, 11:12 AM
This revision is now accepted and ready to land.Mar 15 2018, 11:12 AM
This revision was automatically updated to reflect the committed changes.