Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/udev/udevdevice.cpp
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Line(s) | 141 | { | |||
---|---|---|---|---|---|
142 | switch (type) { | 142 | switch (type) { | ||
143 | case Solid::DeviceInterface::GenericInterface: | 143 | case Solid::DeviceInterface::GenericInterface: | ||
144 | return true; | 144 | return true; | ||
145 | 145 | | |||
146 | case Solid::DeviceInterface::Processor: | 146 | case Solid::DeviceInterface::Processor: | ||
147 | return m_device.subsystem() == QLatin1String("cpu"); | 147 | return m_device.subsystem() == QLatin1String("cpu"); | ||
148 | 148 | | |||
149 | case Solid::DeviceInterface::Camera: | 149 | case Solid::DeviceInterface::Camera: | ||
150 | return property("ID_GPHOTO2").toInt() == 1; | 150 | return m_device.subsystem() == QLatin1String("usb") && property("ID_GPHOTO2").isValid(); | ||
151 | 151 | | |||
152 | case Solid::DeviceInterface::PortableMediaPlayer: | 152 | case Solid::DeviceInterface::PortableMediaPlayer: | ||
153 | return m_device.subsystem() == QLatin1String("usb") && !property("ID_MEDIA_PLAYER").toString().isEmpty(); | 153 | return m_device.subsystem() == QLatin1String("usb") && property("ID_MEDIA_PLAYER").isValid(); | ||
154 | 154 | | |||
155 | case Solid::DeviceInterface::Block: | 155 | case Solid::DeviceInterface::Block: | ||
156 | return !property("MAJOR").toString().isEmpty(); | 156 | return !property("MAJOR").toString().isEmpty(); | ||
157 | 157 | | |||
158 | default: | 158 | default: | ||
159 | return false; | 159 | return false; | ||
160 | } | 160 | } | ||
161 | } | 161 | } | ||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |