diff options
author | Johannes Zellner <johannes.zellner@nokia.com> | 2012-05-17 13:13:57 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-21 03:10:49 +0200 |
commit | 278e9cb65d5e7a337c4747317c84b2da776a5a16 (patch) | |
tree | 3ae21b4256133df1cbbfa908c01a59827512b44e /src/plugins/generic | |
parent | 11fa02c5cda08ea8eb83d61113c7fb1571d8e7b2 (diff) |
Input: evdevmouse plugin cleanup
Remove unused code and variables from the evdevmouse plugin.
Change-Id: Id7881bc726b5ffb2fa452e4d4dd082fe70f7ed28
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'src/plugins/generic')
-rw-r--r-- | src/plugins/generic/evdevmouse/qevdevmousehandler.cpp | 30 | ||||
-rw-r--r-- | src/plugins/generic/evdevmouse/qevdevmousehandler.h | 5 |
2 files changed, 13 insertions, 22 deletions
diff --git a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp index 6edd470874..73da200d17 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp +++ b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp @@ -72,8 +72,6 @@ QEvdevMouseHandler *QEvdevMouseHandler::createLinuxInputMouseHandler(const QStri QString device = "/dev/input/event0"; bool compression = true; - bool clamp = true; - bool smooth = false; int jitterLimit = 0; int xoffset = 0; int yoffset = 0; @@ -82,8 +80,6 @@ QEvdevMouseHandler *QEvdevMouseHandler::createLinuxInputMouseHandler(const QStri foreach (const QString &arg, args) { if (arg == "nocompress") compression = false; - else if (arg == "noclamp") - clamp = false; else if (arg.startsWith("dejitter=")) jitterLimit = arg.mid(9).toInt(); else if (arg.startsWith("xoffset=")) @@ -101,16 +97,16 @@ QEvdevMouseHandler *QEvdevMouseHandler::createLinuxInputMouseHandler(const QStri int fd; fd = qt_safe_open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0); if (fd >= 0) { - return new QEvdevMouseHandler(fd, compression, clamp, smooth, jitterLimit, xoffset, yoffset); + return new QEvdevMouseHandler(fd, compression, jitterLimit, xoffset, yoffset); } else { qWarning("Cannot open mouse input device '%s': %s", qPrintable(device), strerror(errno)); return 0; } } -QEvdevMouseHandler::QEvdevMouseHandler(int deviceDescriptor, bool compression, bool clamp, bool smooth, int jitterLimit, int xoffset, int yoffset) +QEvdevMouseHandler::QEvdevMouseHandler(int deviceDescriptor, bool compression, int jitterLimit, int xoffset, int yoffset) : m_notify(0), m_x(0), m_y(0), m_prevx(0), m_prevy(0), - m_fd(deviceDescriptor), m_compression(compression), m_clamp(clamp), m_smooth(smooth), + m_fd(deviceDescriptor), m_compression(compression), m_xoffset(xoffset), m_yoffset(yoffset), m_buttons(0) { setObjectName(QLatin1String("Evdev Mouse Handler")); @@ -131,18 +127,16 @@ QEvdevMouseHandler::~QEvdevMouseHandler() void QEvdevMouseHandler::sendMouseEvent() { - if (m_clamp) { - QRect g = QGuiApplication::primaryScreen()->virtualGeometry(); - if (m_x + m_xoffset < g.left()) - m_x = g.left() - m_xoffset; - else if (m_x + m_xoffset > g.right()) - m_x = g.right() - m_xoffset; + QRect g = QGuiApplication::primaryScreen()->virtualGeometry(); + if (m_x + m_xoffset < g.left()) + m_x = g.left() - m_xoffset; + else if (m_x + m_xoffset > g.right()) + m_x = g.right() - m_xoffset; - if (m_y + m_yoffset < g.top()) - m_y = g.top() - m_yoffset; - else if (m_y + m_yoffset > g.bottom()) - m_y = g.bottom() - m_yoffset; - } + if (m_y + m_yoffset < g.top()) + m_y = g.top() - m_yoffset; + else if (m_y + m_yoffset > g.bottom()) + m_y = g.bottom() - m_yoffset; QPoint pos(m_x + m_xoffset, m_y + m_yoffset); diff --git a/src/plugins/generic/evdevmouse/qevdevmousehandler.h b/src/plugins/generic/evdevmouse/qevdevmousehandler.h index fc65c6a414..e8fe1928c3 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousehandler.h +++ b/src/plugins/generic/evdevmouse/qevdevmousehandler.h @@ -62,7 +62,7 @@ private slots: void readMouseData(); private: - QEvdevMouseHandler(int deviceDescriptor, bool compression, bool clamp, bool smooth, int jitterLimit, int xoffset, int yoffset); + QEvdevMouseHandler(int deviceDescriptor, bool compression, int jitterLimit, int xoffset, int yoffset); void sendMouseEvent(); @@ -71,11 +71,8 @@ private: int m_prevx, m_prevy; int m_fd; bool m_compression; - bool m_clamp; - bool m_smooth; int m_xoffset, m_yoffset; Qt::MouseButtons m_buttons; - int m_smoothx, m_smoothy; int m_jitterLimitSquared; }; |