diff options
author | Johannes Zellner <johannes.zellner@nokia.com> | 2012-03-12 17:52:27 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-14 09:45:07 +0100 |
commit | 3a47c13fa655674aa1d3ff8e82bf67b83d42b285 (patch) | |
tree | d9fcb13583336b5e6665ec1d42fdb193d044fb80 /src/plugins/generic/evdevtouch | |
parent | f4dfb55243cccf8bbf4176fee856f945f8564171 (diff) |
remove obsolete qudevhelper and adopt mouse and touch plugins
The QUDevHelper class is now replaced by QUDeviceHelper class.
All evdev input plugins are using the new udev helper now to enable
hotplugin for keyboard and mouse input.
EvdevTouch plugin still only uses the first detected device by udev,
this cannot be tested on my side, due to the lack of multiple touch input devices.
Change-Id: I01a4cfe1a80000bfb27c67a2f53faf560906b73c
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/plugins/generic/evdevtouch')
-rw-r--r-- | src/plugins/generic/evdevtouch/qevdevtouch.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/generic/evdevtouch/qevdevtouch.cpp b/src/plugins/generic/evdevtouch/qevdevtouch.cpp index 9e6347457d..b702807cab 100644 --- a/src/plugins/generic/evdevtouch/qevdevtouch.cpp +++ b/src/plugins/generic/evdevtouch/qevdevtouch.cpp @@ -46,7 +46,7 @@ #include <QGuiApplication> #include <QDebug> #include <QtCore/private/qcore_unix_p.h> -#include <QtPlatformSupport/private/qudevhelper_p.h> +#include <QtPlatformSupport/private/qudevicehelper_p.h> #include <linux/input.h> #ifdef USE_MTDEV @@ -146,7 +146,17 @@ QTouchScreenHandler::QTouchScreenHandler(const QString &spec) setObjectName(QLatin1String("Evdev Touch Handler")); QString dev; - q_udev_devicePath(UDev_Touchpad | UDev_Touchscreen, &dev); + + // 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(); + + // only the first device found is used for now + if (devices.size() > 0) + dev = devices[0]; + } + if (dev.isEmpty()) dev = QLatin1String("/dev/input/event0"); |