summaryrefslogtreecommitdiffstats
path: root/src/plugins/generic/evdevtouch
diff options
context:
space:
mode:
authorJohannes Zellner <johannes.zellner@nokia.com>2012-05-21 15:41:58 -0700
committerQt by Nokia <qt-info@nokia.com>2012-05-24 07:15:02 +0200
commitce5c1db2d3db7d7c7af28e9053ca591f76c6101c (patch)
tree60ef0eac7ad658e9715f2a940dbf7c5a3b6787a4 /src/plugins/generic/evdevtouch
parent7dd64fd2bbb18a424577543307f2821ace963b8b (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')
-rw-r--r--src/plugins/generic/evdevtouch/qevdevtouch.cpp14
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);