From 35ed524d9226cb705081737652d72d5cbb86e6c6 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 30 Aug 2017 12:32:29 +0200 Subject: evdev*,libinput: use functor-based connections This results in less boilerplate code, among other benefits that come with functor-based connections. Simple expressions have been converted to use lambda. Change-Id: I6887980524027eada24beed95e6f9ba43f0fc8d5 Reviewed-by: Laszlo Agocs --- src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | 2 +- src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h | 2 -- src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp | 7 +++++-- src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h | 2 -- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/platformsupport/input/evdevtouch') diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index 8cce403b31..df2c079f24 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -229,7 +229,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const if (m_fd >= 0) { m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); - connect(m_notify, SIGNAL(activated(int)), this, SLOT(readData())); + connect(m_notify, &QSocketNotifier::activated, this, &QEvdevTouchScreenHandler::readData); } else { qErrnoWarning(errno, "evdevtouch: Cannot open input device %s", qPrintable(device)); return; diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h index d22aca3266..a0b689a89e 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h @@ -82,7 +82,6 @@ public: bool isFiltered() const; -private slots: void readData(); signals: @@ -116,7 +115,6 @@ public: bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE; -public slots: void scheduleTouchPointUpdate(); signals: diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp index ab71d08fb1..4cacbf03e5 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp @@ -88,8 +88,11 @@ QEvdevTouchManager::QEvdevTouchManager(const QString &key, const QString &specif const QStringList devices = m_deviceDiscovery->scanConnectedDevices(); for (const QString &device : devices) addDevice(device); - connect(m_deviceDiscovery, SIGNAL(deviceDetected(QString)), this, SLOT(addDevice(QString))); - connect(m_deviceDiscovery, SIGNAL(deviceRemoved(QString)), this, SLOT(removeDevice(QString))); + + connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected, + this, &QEvdevTouchManager::addDevice); + connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved, + this, &QEvdevTouchManager::removeDevice); } } } diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h index 84e857ca57..e524c516f1 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h +++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h @@ -62,12 +62,10 @@ class QEvdevTouchScreenHandlerThread; class QEvdevTouchManager : public QObject { - Q_OBJECT public: QEvdevTouchManager(const QString &key, const QString &spec, QObject *parent = 0); ~QEvdevTouchManager(); -private slots: void addDevice(const QString &deviceNode); void removeDevice(const QString &deviceNode); -- cgit v1.2.3