diff options
author | Johannes Zellner <johannes.zellner@nokia.com> | 2012-05-25 16:42:55 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-30 04:25:48 +0200 |
commit | e6a4d6054d6c4c9c2d8796255659bb6b3fcca635 (patch) | |
tree | 0d925b86b6ed07b6679c10b712043811916a3efc /src/plugins/generic/evdevmouse/qevdevmousehandler.cpp | |
parent | a530ffd6def62b0d81f8bdfd02e54c62cd4d8d8f (diff) |
evdev: Cleanup mouse and keyboard plugins
Remove fallback event0 device usage. All available devices should be
detected automatically from DeviceDiscovery either through udev or the
static fallback discovery method. This also removes the never used 'key'
argument, which was pulled over from Qt4.
Change-Id: Iffe8bd80f0770664024019a220cbbc6f98843340
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'src/plugins/generic/evdevmouse/qevdevmousehandler.cpp')
-rw-r--r-- | src/plugins/generic/evdevmouse/qevdevmousehandler.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp index 55392c20c4..439d2c095a 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp +++ b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp @@ -62,15 +62,12 @@ QT_BEGIN_NAMESPACE -QEvdevMouseHandler *QEvdevMouseHandler::createLinuxInputMouseHandler(const QString &key, const QString &specification) +QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QString &specification) { #ifdef QT_QPA_MOUSE_HANDLER_DEBUG - qWarning() << "Try to create mouse handler with" << key << specification; -#else - Q_UNUSED(key) + qWarning() << "Try to create mouse handler for" << device << specification; #endif - QString device = "/dev/input/event0"; bool compression = true; int jitterLimit = 0; @@ -80,28 +77,21 @@ QEvdevMouseHandler *QEvdevMouseHandler::createLinuxInputMouseHandler(const QStri compression = false; else if (arg.startsWith("dejitter=")) jitterLimit = arg.mid(9).toInt(); - else if (arg.startsWith(QLatin1String("/dev/"))) - device = arg; } -#ifdef QT_QPA_MOUSE_HANDLER_DEBUG - qDebug("evdevmouse: Using device %s", qPrintable(device)); -#endif - int fd; fd = qt_safe_open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0); if (fd >= 0) { - return new QEvdevMouseHandler(fd, compression, jitterLimit); + return new QEvdevMouseHandler(device, fd, compression, jitterLimit); } else { qWarning("Cannot open mouse input device '%s': %s", qPrintable(device), strerror(errno)); return 0; } } -QEvdevMouseHandler::QEvdevMouseHandler(int deviceDescriptor, bool compression, int jitterLimit) - : m_notify(0), m_x(0), m_y(0), m_prevx(0), m_prevy(0), - m_fd(deviceDescriptor), m_compression(compression), - m_buttons(0) +QEvdevMouseHandler::QEvdevMouseHandler(const QString &device, int fd, bool compression, int jitterLimit) + : m_device(device), m_fd(fd), m_notify(0), m_x(0), m_y(0), m_prevx(0), m_prevy(0), + m_compression(compression), m_buttons(0) { setObjectName(QLatin1String("Evdev Mouse Handler")); |