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