Checking input mask before scanning evdev devices
Adding device mask verification for static device discovery. DRM devices are no longer scanned if mask is set to input devices only Change-Id: Ibd2e77280c2d93c707ba7bdb84c4ae3cb0932178 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
parent
2d67bf07fe
commit
c6d3fe8873
@ -102,23 +102,27 @@ QDeviceDiscovery::~QDeviceDiscovery()
|
||||
QStringList QDeviceDiscovery::scanConnectedDevices()
|
||||
{
|
||||
QStringList devices;
|
||||
|
||||
// check for input devices
|
||||
QDir dir(QString::fromLatin1(QT_EVDEV_DEVICE_PATH));
|
||||
QDir dir;
|
||||
dir.setFilter(QDir::System);
|
||||
|
||||
foreach (const QString &deviceFile, dir.entryList()) {
|
||||
QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
|
||||
if (checkDeviceType(absoluteFilePath))
|
||||
devices << absoluteFilePath;
|
||||
// check for input devices
|
||||
if (m_types & Device_InputMask) {
|
||||
dir.setPath(QString::fromLatin1(QT_EVDEV_DEVICE_PATH));
|
||||
foreach (const QString &deviceFile, dir.entryList()) {
|
||||
QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
|
||||
if (checkDeviceType(absoluteFilePath))
|
||||
devices << absoluteFilePath;
|
||||
}
|
||||
}
|
||||
|
||||
// check for drm devices
|
||||
dir.setPath(QString::fromLatin1(QT_DRM_DEVICE_PATH));
|
||||
foreach (const QString &deviceFile, dir.entryList()) {
|
||||
QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
|
||||
if (checkDeviceType(absoluteFilePath))
|
||||
devices << absoluteFilePath;
|
||||
if (m_types & Device_VideoMask) {
|
||||
dir.setPath(QString::fromLatin1(QT_DRM_DEVICE_PATH));
|
||||
foreach (const QString &deviceFile, dir.entryList()) {
|
||||
QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
|
||||
if (checkDeviceType(absoluteFilePath))
|
||||
devices << absoluteFilePath;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef QT_QPA_DEVICE_DISCOVERY_DEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user