D21425: [UDev Backend] Filter for ID_MEDIA_PLAYER already when querying
Kai Uwe Broulik
noreply at phabricator.kde.org
Mon May 27 10:53:33 BST 2019
broulik created this revision.
broulik added reviewers: Frameworks, davidedmundson, bruns.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
broulik requested review of this revision.
REVISION SUMMARY
This avoids us creating wrapper objects for UDev devices we end up not being interested in.
According to `match_property` [1] which filters the properties added by `sd_device_enumerator_add_match_property` which `udev_enumerate_add_match_property` ends up calling, a `value` of `NULL` can be used to check for mere existance of a property.
[1] https://github.com/systemd/systemd/blob/master/src/libsystemd/sd-device/device-enumerator.c#L400
TEST PLAN
Depends on D21379 <https://phabricator.kde.org/D21379>
I recall having done a patch like this before and ran into trouble but my phone shows up just fine both on startup and when plugging it in later. I think the check for `1` vs `"1"` being the culprit here, so just check for property existance which filters out most of the useless devices already.
REPOSITORY
R245 Solid
REVISION DETAIL
https://phabricator.kde.org/D21425
AFFECTED FILES
src/solid/devices/backends/udev/udevmanager.cpp
To: broulik, #frameworks, davidedmundson, bruns
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190527/1842d8f7/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list