Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/udev/udevmanager.cpp
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Line(s) | 177 | { | |||
---|---|---|---|---|---|
194 | 194 | | |||
195 | UdevQt::DeviceList deviceList; | 195 | UdevQt::DeviceList deviceList; | ||
196 | 196 | | |||
197 | // Already limit the number of devices we query and have to create wrapper items for here | 197 | // Already limit the number of devices we query and have to create wrapper items for here | ||
198 | if (type == Solid::DeviceInterface::Processor) { | 198 | if (type == Solid::DeviceInterface::Processor) { | ||
199 | deviceList = d->m_client->devicesBySubsystem(QStringLiteral("processor")) | 199 | deviceList = d->m_client->devicesBySubsystem(QStringLiteral("processor")) | ||
200 | + d->m_client->devicesBySubsystem(QStringLiteral("cpu")); | 200 | + d->m_client->devicesBySubsystem(QStringLiteral("cpu")); | ||
201 | } else if (type == Solid::DeviceInterface::Camera) { | 201 | } else if (type == Solid::DeviceInterface::Camera) { | ||
202 | deviceList = d->m_client->devicesByProperty("ID_GPHOTO2", 1); | 202 | deviceList = d->m_client->devicesBySubsystemsAndProperties({ | ||
203 | QStringLiteral("usb"), | ||||
204 | }, { | ||||
205 | {QStringLiteral("ID_GPHOTO2"), QStringLiteral("*")} // match any | ||||
206 | }); | ||||
203 | } else if (type == Solid::DeviceInterface::PortableMediaPlayer) { | 207 | } else if (type == Solid::DeviceInterface::PortableMediaPlayer) { | ||
204 | deviceList = d->m_client->devicesBySubsystem(QStringLiteral("usb")); | 208 | deviceList = d->m_client->devicesBySubsystemsAndProperties({ | ||
205 | } else if (type != Solid::DeviceInterface::Unknown) { | 209 | QStringLiteral("usb"), | ||
210 | }, { | ||||
211 | {QStringLiteral("ID_MEDIA_PLAYER"), QStringLiteral("*")} // match any | ||||
212 | }); | ||||
213 | } else { | ||||
206 | deviceList = d->m_client->allDevices(); | 214 | deviceList = d->m_client->allDevices(); | ||
207 | } | 215 | } | ||
208 | 216 | | |||
209 | for (const UdevQt::Device &dev : qAsConst(deviceList)) { | 217 | for (const UdevQt::Device &dev : qAsConst(deviceList)) { | ||
210 | UDevDevice device(dev); | 218 | UDevDevice device(dev); | ||
211 | if (device.queryDeviceInterface(type) && d->isOfInterest(udiPrefix() + dev.sysfsPath(), dev)) { | 219 | if (device.queryDeviceInterface(type) && d->isOfInterest(udiPrefix() + dev.sysfsPath(), dev)) { | ||
212 | result << udiPrefix() + dev.sysfsPath(); | 220 | result << udiPrefix() + dev.sysfsPath(); | ||
213 | } | 221 | } | ||
Show All 40 Lines |