diff options
author | Johannes Zellner <johannes.zellner@nokia.com> | 2012-05-21 15:41:58 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-24 07:15:02 +0200 |
commit | ce5c1db2d3db7d7c7af28e9053ca591f76c6101c (patch) | |
tree | 60ef0eac7ad658e9715f2a940dbf7c5a3b6787a4 /src/plugins/generic/evdevtouch/qevdevtouch.cpp | |
parent | 7dd64fd2bbb18a424577543307f2821ace963b8b (diff) |
udev: UDevHelper becomes DeviceDiscovery
Rename QUDeviceHelper to QDeviceDiscovery and add a static device
discovery fallback in case we dont have udev. The fallback so far only
scans /dev/input/event* and /dev/dri/card* at startup and detects device
nodes only by device path.
Change-Id: I7a423910b30ae16a10d8f1f47b86c6b4d2c2ec36
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Diffstat (limited to 'src/plugins/generic/evdevtouch/qevdevtouch.cpp')
-rw-r--r-- | src/plugins/generic/evdevtouch/qevdevtouch.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/plugins/generic/evdevtouch/qevdevtouch.cpp b/src/plugins/generic/evdevtouch/qevdevtouch.cpp index 37db20a419..c372b0d1ff 100644 --- a/src/plugins/generic/evdevtouch/qevdevtouch.cpp +++ b/src/plugins/generic/evdevtouch/qevdevtouch.cpp @@ -46,9 +46,7 @@ #include <QGuiApplication> #include <QDebug> #include <QtCore/private/qcore_unix_p.h> -#ifndef QT_NO_LIBUDEV -#include <QtPlatformSupport/private/qudevicehelper_p.h> -#endif // QT_NO_LIBUDEV +#include <QtPlatformSupport/private/qdevicediscovery_p.h> #include <linux/input.h> #ifdef USE_MTDEV @@ -159,22 +157,20 @@ QTouchScreenHandler::QTouchScreenHandler(const QString &spec) } } -#ifndef QT_NO_LIBUDEV if (dev.isEmpty()) { // try to let udev scan for already connected devices - QScopedPointer<QUDeviceHelper> udeviceHelper(QUDeviceHelper::createUDeviceHelper(QUDeviceHelper::UDev_Touchpad | QUDeviceHelper::UDev_Touchscreen, this)); - if (udeviceHelper) { - QStringList devices = udeviceHelper->scanConnectedDevices(); + QScopedPointer<QDeviceDiscovery> deviceDiscovery(QDeviceDiscovery::create(QDeviceDiscovery::Device_Touchpad | QDeviceDiscovery::Device_Touchscreen, this)); + if (deviceDiscovery) { + QStringList devices = deviceDiscovery->scanConnectedDevices(); // only the first device found is used for now if (devices.size() > 0) dev = devices[0]; } } -#endif // QT_NO_LIBUDEV if (dev.isEmpty()) - dev = QLatin1String("/dev/input/event0"); + return; qDebug("evdevtouch: Using device %s", qPrintable(dev)); m_fd = QT_OPEN(dev.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0); |